unpoly-rails 0.54.0 → 0.54.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of unpoly-rails might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/Rakefile +19 -0
- data/dist/unpoly.js +380 -390
- data/dist/unpoly.min.js +3 -4
- data/lib/assets/javascripts/unpoly/{browser.coffee → browser.coffee.erb} +20 -20
- data/lib/assets/javascripts/unpoly/{bus.coffee → bus.coffee.erb} +17 -17
- data/lib/assets/javascripts/unpoly/classes/cache.coffee +2 -2
- data/lib/assets/javascripts/unpoly/classes/extract_plan.coffee +1 -1
- data/lib/assets/javascripts/unpoly/classes/motion_tracker.coffee +3 -3
- data/lib/assets/javascripts/unpoly/classes/request.coffee +9 -9
- data/lib/assets/javascripts/unpoly/classes/response.coffee +11 -11
- data/lib/assets/javascripts/unpoly/{dom.coffee → dom.coffee.erb} +18 -18
- data/lib/assets/javascripts/unpoly/feedback.coffee +8 -8
- data/lib/assets/javascripts/unpoly/{form.coffee → form.coffee.erb} +20 -20
- data/lib/assets/javascripts/unpoly/history.coffee +12 -12
- data/lib/assets/javascripts/unpoly/{layout.coffee → layout.coffee.erb} +23 -23
- data/lib/assets/javascripts/unpoly/{link.coffee → link.coffee.erb} +18 -18
- data/lib/assets/javascripts/unpoly/log.coffee +9 -9
- data/lib/assets/javascripts/unpoly/{modal.coffee → modal.coffee.erb} +22 -22
- data/lib/assets/javascripts/unpoly/motion.coffee +14 -14
- data/lib/assets/javascripts/unpoly/namespace.coffee.erb +1 -1
- data/lib/assets/javascripts/unpoly/{popup.coffee → popup.coffee.erb} +15 -15
- data/lib/assets/javascripts/unpoly/protocol.coffee +6 -6
- data/lib/assets/javascripts/unpoly/proxy.coffee +20 -20
- data/lib/assets/javascripts/unpoly/radio.coffee +4 -4
- data/lib/assets/javascripts/unpoly/rails.coffee +1 -1
- data/lib/assets/javascripts/unpoly/syntax.coffee +10 -10
- data/lib/assets/javascripts/unpoly/toast.coffee +1 -1
- data/lib/assets/javascripts/unpoly/tooltip.coffee +7 -7
- data/lib/assets/javascripts/unpoly/util.coffee +107 -107
- data/lib/unpoly/rails/version.rb +1 -1
- data/package.json +1 -1
- data/spec_app/Gemfile.lock +1 -1
- data/spec_app/config/application.rb +2 -0
- data/spec_app/spec/javascripts/helpers/to_have_unhandled_rejections.coffee +3 -0
- data/spec_app/spec/javascripts/up/form_spec.js.coffee +4 -3
- data/spec_app/spec/javascripts/up/link_spec.js.coffee +1 -1
- data/spec_app/spec/javascripts/up/proxy_spec.js.coffee +1 -1
- metadata +10 -10
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
###**
|
2
2
|
Passive updates
|
3
3
|
===============
|
4
4
|
|
@@ -11,7 +11,7 @@ up.radio = (($) ->
|
|
11
11
|
|
12
12
|
u = up.util
|
13
13
|
|
14
|
-
|
14
|
+
###**
|
15
15
|
Configures defaults for passive updates.
|
16
16
|
|
17
17
|
@property up.radio.config
|
@@ -34,14 +34,14 @@ up.radio = (($) ->
|
|
34
34
|
reset = ->
|
35
35
|
config.reset()
|
36
36
|
|
37
|
-
|
37
|
+
###**
|
38
38
|
@function up.radio.hungrySelector
|
39
39
|
@internal
|
40
40
|
###
|
41
41
|
hungrySelector = ->
|
42
42
|
u.multiSelector(config.hungry)
|
43
43
|
|
44
|
-
|
44
|
+
###**
|
45
45
|
Elements with this attribute are [updated](/up.replace) whenever there is a
|
46
46
|
matching element found in a successful response. The element is replaced even
|
47
47
|
when it isn't [targeted](/a-up-target) directly.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
###**
|
2
2
|
Custom JavaScript
|
3
3
|
=================
|
4
4
|
|
@@ -39,7 +39,7 @@ up.syntax = (($) ->
|
|
39
39
|
compilers = []
|
40
40
|
macros = []
|
41
41
|
|
42
|
-
|
42
|
+
###**
|
43
43
|
Registers a function to be called whenever an element with
|
44
44
|
the given selector is inserted into the DOM.
|
45
45
|
|
@@ -225,7 +225,7 @@ up.syntax = (($) ->
|
|
225
225
|
options = u.options(args[0])
|
226
226
|
insertCompiler(compilers, selector, options, callback)
|
227
227
|
|
228
|
-
|
228
|
+
###**
|
229
229
|
Registers a [compiler](/up.compiler) that is run before all other compilers.
|
230
230
|
|
231
231
|
You can use `up.macro()` to register a compiler that sets other UJS attributes.
|
@@ -307,7 +307,7 @@ up.syntax = (($) ->
|
|
307
307
|
returnValue = compiler.callback.apply(nativeElement, [$jqueryElement, data($jqueryElement)])
|
308
308
|
addDestructor($jqueryElement, returnValue)
|
309
309
|
|
310
|
-
|
310
|
+
###**
|
311
311
|
Tries to find a list of destructors in a compiler's return value.
|
312
312
|
|
313
313
|
@param {Object} returnValue
|
@@ -332,7 +332,7 @@ up.syntax = (($) ->
|
|
332
332
|
$element.removeData(DESTRUCTORS_KEY)
|
333
333
|
$element.removeClass(DESTRUCTIBLE_CLASS)
|
334
334
|
|
335
|
-
|
335
|
+
###**
|
336
336
|
Applies all compilers on the given element and its descendants.
|
337
337
|
Unlike [`up.hello()`](/up.hello), this doesn't emit any events.
|
338
338
|
|
@@ -367,7 +367,7 @@ up.syntax = (($) ->
|
|
367
367
|
else
|
368
368
|
$matches.each -> applyCompiler(compiler, $(this), this)
|
369
369
|
|
370
|
-
|
370
|
+
###**
|
371
371
|
Runs any destroyers on the given fragment and its descendants.
|
372
372
|
Unlike [`up.destroy()`](/up.destroy), this doesn't emit any events
|
373
373
|
and does not remove the element from the DOM.
|
@@ -378,7 +378,7 @@ up.syntax = (($) ->
|
|
378
378
|
clean = ($fragment) ->
|
379
379
|
prepareClean($fragment)()
|
380
380
|
|
381
|
-
|
381
|
+
###**
|
382
382
|
@function up.syntax.prepareClean
|
383
383
|
@param {jQuery} $fragment
|
384
384
|
@return {Function}
|
@@ -393,7 +393,7 @@ up.syntax = (($) ->
|
|
393
393
|
destructors = u.compact destructors
|
394
394
|
u.sequence(destructors...)
|
395
395
|
|
396
|
-
|
396
|
+
###**
|
397
397
|
Checks if the given element has an [`up-data`](/up-data) attribute.
|
398
398
|
If yes, parses the attribute value as JSON and returns the parsed object.
|
399
399
|
|
@@ -418,7 +418,7 @@ up.syntax = (($) ->
|
|
418
418
|
@stable
|
419
419
|
###
|
420
420
|
|
421
|
-
|
421
|
+
###**
|
422
422
|
If an element with an `up-data` attribute enters the DOM,
|
423
423
|
Unpoly will parse the JSON and pass the resulting object to any matching
|
424
424
|
[`up.compiler()`](/up.compiler) handlers.
|
@@ -469,7 +469,7 @@ up.syntax = (($) ->
|
|
469
469
|
else
|
470
470
|
{}
|
471
471
|
|
472
|
-
|
472
|
+
###**
|
473
473
|
Resets the list of registered compiler directives to the
|
474
474
|
moment when the framework was booted.
|
475
475
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
###**
|
2
2
|
Tooltips
|
3
3
|
========
|
4
4
|
|
@@ -33,7 +33,7 @@ up.tooltip = (($) ->
|
|
33
33
|
|
34
34
|
u = up.util
|
35
35
|
|
36
|
-
|
36
|
+
###**
|
37
37
|
Configures defaults for future tooltips.
|
38
38
|
|
39
39
|
@property up.tooltip.config
|
@@ -116,7 +116,7 @@ up.tooltip = (($) ->
|
|
116
116
|
$element.appendTo(document.body)
|
117
117
|
state.$tooltip = $element
|
118
118
|
|
119
|
-
|
119
|
+
###**
|
120
120
|
Opens a tooltip over the given element.
|
121
121
|
|
122
122
|
The unobtrusive variant of this is the [`[up-tooltip]`](/up-tooltip) selector.
|
@@ -170,7 +170,7 @@ up.tooltip = (($) ->
|
|
170
170
|
up.animate(state.$tooltip, animation, animateOptions).then ->
|
171
171
|
state.phase = 'opened'
|
172
172
|
|
173
|
-
|
173
|
+
###**
|
174
174
|
Closes a currently shown tooltip.
|
175
175
|
|
176
176
|
Does nothing if no tooltip is currently shown.
|
@@ -198,7 +198,7 @@ up.tooltip = (($) ->
|
|
198
198
|
state.$tooltip = null
|
199
199
|
state.$anchor = null
|
200
200
|
|
201
|
-
|
201
|
+
###**
|
202
202
|
Returns whether a tooltip is currently showing.
|
203
203
|
|
204
204
|
@function up.tooltip.isOpen
|
@@ -207,7 +207,7 @@ up.tooltip = (($) ->
|
|
207
207
|
isOpen = ->
|
208
208
|
state.phase == 'opening' || state.phase == 'opened'
|
209
209
|
|
210
|
-
|
210
|
+
###**
|
211
211
|
Displays a tooltip with text content when hovering the mouse over this element.
|
212
212
|
|
213
213
|
\#\#\# Example
|
@@ -230,7 +230,7 @@ up.tooltip = (($) ->
|
|
230
230
|
@stable
|
231
231
|
###
|
232
232
|
|
233
|
-
|
233
|
+
###**
|
234
234
|
Displays a tooltip with HTML content when hovering the mouse over this element:
|
235
235
|
|
236
236
|
<a href="/decks" up-tooltip-html="Show <b>all</b> decks">Decks</a>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
###**
|
2
2
|
Utility functions
|
3
3
|
=================
|
4
4
|
|
@@ -9,7 +9,7 @@ that might save you from loading something like [Lodash](https://lodash.com/).
|
|
9
9
|
###
|
10
10
|
up.util = (($) ->
|
11
11
|
|
12
|
-
|
12
|
+
###**
|
13
13
|
A function that does nothing.
|
14
14
|
|
15
15
|
@function up.util.noop
|
@@ -17,7 +17,7 @@ up.util = (($) ->
|
|
17
17
|
###
|
18
18
|
noop = $.noop
|
19
19
|
|
20
|
-
|
20
|
+
###**
|
21
21
|
Ensures that the given function can only be called a single time.
|
22
22
|
Subsequent calls will return the return value of the first call.
|
23
23
|
|
@@ -37,7 +37,7 @@ up.util = (($) ->
|
|
37
37
|
cached = true
|
38
38
|
cachedValue = func(args...)
|
39
39
|
|
40
|
-
|
40
|
+
###**
|
41
41
|
Returns if the given port is the default port for the given protocol.
|
42
42
|
|
43
43
|
@function up.util.isStandardPort
|
@@ -47,7 +47,7 @@ up.util = (($) ->
|
|
47
47
|
port = port.toString()
|
48
48
|
((port == "" || port == "80") && protocol == 'http:') || (port == "443" && protocol == 'https:')
|
49
49
|
|
50
|
-
|
50
|
+
###**
|
51
51
|
Normalizes relative paths and absolute paths to a full URL
|
52
52
|
that can be checked for equality with other normalized URLs.
|
53
53
|
|
@@ -82,7 +82,7 @@ up.util = (($) ->
|
|
82
82
|
targetUrl = parseUrl(targetUrl)
|
83
83
|
currentUrl.protocol != targetUrl.protocol || currentUrl.host != targetUrl.host
|
84
84
|
|
85
|
-
|
85
|
+
###**
|
86
86
|
Parses the given URL into components such as hostname and path.
|
87
87
|
|
88
88
|
If the given URL is not fully qualified, it is assumed to be relative
|
@@ -111,7 +111,7 @@ up.util = (($) ->
|
|
111
111
|
anchor.href = anchor.href if isBlank(anchor.hostname)
|
112
112
|
anchor
|
113
113
|
|
114
|
-
|
114
|
+
###**
|
115
115
|
@function up.util.normalizeMethod
|
116
116
|
@internal
|
117
117
|
###
|
@@ -121,14 +121,14 @@ up.util = (($) ->
|
|
121
121
|
else
|
122
122
|
'GET'
|
123
123
|
|
124
|
-
|
124
|
+
###**
|
125
125
|
@function up.util.methodAllowsPayload
|
126
126
|
@internal
|
127
127
|
###
|
128
128
|
methodAllowsPayload = (method) ->
|
129
129
|
method != 'GET' && method != 'HEAD'
|
130
130
|
|
131
|
-
|
131
|
+
###**
|
132
132
|
@function $createElementFromSelector
|
133
133
|
@internal
|
134
134
|
###
|
@@ -158,7 +158,7 @@ up.util = (($) ->
|
|
158
158
|
$parent = $element
|
159
159
|
$root
|
160
160
|
|
161
|
-
|
161
|
+
###**
|
162
162
|
@function $create
|
163
163
|
###
|
164
164
|
$createPlaceholder = (selector, container = document.body) ->
|
@@ -167,7 +167,7 @@ up.util = (($) ->
|
|
167
167
|
$placeholder.appendTo(container)
|
168
168
|
$placeholder
|
169
169
|
|
170
|
-
|
170
|
+
###**
|
171
171
|
Returns a CSS selector that matches the given element as good as possible.
|
172
172
|
|
173
173
|
This uses, in decreasing order of priority:
|
@@ -230,7 +230,7 @@ up.util = (($) ->
|
|
230
230
|
target[key] = value
|
231
231
|
target
|
232
232
|
|
233
|
-
|
233
|
+
###**
|
234
234
|
Merge the own properties of one or more `sources` into the `target` object.
|
235
235
|
|
236
236
|
@function up.util.assign
|
@@ -240,7 +240,7 @@ up.util = (($) ->
|
|
240
240
|
###
|
241
241
|
assign = Object.assign || assignPolyfill
|
242
242
|
|
243
|
-
|
243
|
+
###**
|
244
244
|
Returns a new string with whitespace removed from the beginning
|
245
245
|
and end of the given string.
|
246
246
|
|
@@ -252,7 +252,7 @@ up.util = (($) ->
|
|
252
252
|
###
|
253
253
|
trim = $.trim
|
254
254
|
|
255
|
-
|
255
|
+
###**
|
256
256
|
Calls the given function for each element (and, optional, index)
|
257
257
|
of the given array.
|
258
258
|
|
@@ -265,7 +265,7 @@ up.util = (($) ->
|
|
265
265
|
each = (array, block) ->
|
266
266
|
block(item, index) for item, index in array
|
267
267
|
|
268
|
-
|
268
|
+
###**
|
269
269
|
Translate all items in an array to new array of items.
|
270
270
|
|
271
271
|
@function up.util.map
|
@@ -278,7 +278,7 @@ up.util = (($) ->
|
|
278
278
|
###
|
279
279
|
map = each
|
280
280
|
|
281
|
-
|
281
|
+
###**
|
282
282
|
Calls the given function for the given number of times.
|
283
283
|
|
284
284
|
@function up.util.times
|
@@ -289,7 +289,7 @@ up.util = (($) ->
|
|
289
289
|
times = (count, block) ->
|
290
290
|
block(iteration) for iteration in [0..(count - 1)]
|
291
291
|
|
292
|
-
|
292
|
+
###**
|
293
293
|
Returns whether the given argument is `null`.
|
294
294
|
|
295
295
|
@function up.util.isNull
|
@@ -300,7 +300,7 @@ up.util = (($) ->
|
|
300
300
|
isNull = (object) ->
|
301
301
|
object == null
|
302
302
|
|
303
|
-
|
303
|
+
###**
|
304
304
|
Returns whether the given argument is `undefined`.
|
305
305
|
|
306
306
|
@function up.util.isUndefined
|
@@ -311,7 +311,7 @@ up.util = (($) ->
|
|
311
311
|
isUndefined = (object) ->
|
312
312
|
object == undefined
|
313
313
|
|
314
|
-
|
314
|
+
###**
|
315
315
|
Returns whether the given argument is not `undefined`.
|
316
316
|
|
317
317
|
@function up.util.isDefined
|
@@ -322,7 +322,7 @@ up.util = (($) ->
|
|
322
322
|
isDefined = (object) ->
|
323
323
|
!isUndefined(object)
|
324
324
|
|
325
|
-
|
325
|
+
###**
|
326
326
|
Returns whether the given argument is either `undefined` or `null`.
|
327
327
|
|
328
328
|
Note that empty strings or zero are *not* considered to be "missing".
|
@@ -337,7 +337,7 @@ up.util = (($) ->
|
|
337
337
|
isMissing = (object) ->
|
338
338
|
isUndefined(object) || isNull(object) # || isNaN(object)
|
339
339
|
|
340
|
-
|
340
|
+
###**
|
341
341
|
Returns whether the given argument is neither `undefined` nor `null`.
|
342
342
|
|
343
343
|
Note that empty strings or zero *are* considered to be "given".
|
@@ -355,7 +355,7 @@ up.util = (($) ->
|
|
355
355
|
# isNan = (object) ->
|
356
356
|
# isNumber(value) && value != +value
|
357
357
|
|
358
|
-
|
358
|
+
###**
|
359
359
|
Return whether the given argument is considered to be blank.
|
360
360
|
|
361
361
|
This returns `true` for:
|
@@ -378,7 +378,7 @@ up.util = (($) ->
|
|
378
378
|
(isObject(object) && Object.keys(object).length == 0) ||
|
379
379
|
(object.length == 0) # string, Array, jQuery
|
380
380
|
|
381
|
-
|
381
|
+
###**
|
382
382
|
Returns the given argument if the argument is [present](/up.util.isPresent),
|
383
383
|
otherwise returns `undefined`.
|
384
384
|
|
@@ -392,7 +392,7 @@ up.util = (($) ->
|
|
392
392
|
presence = (object, tester = isPresent) ->
|
393
393
|
if tester(object) then object else undefined
|
394
394
|
|
395
|
-
|
395
|
+
###**
|
396
396
|
Returns whether the given argument is not [blank](/up.util.isBlank).
|
397
397
|
|
398
398
|
@function up.util.isPresent
|
@@ -403,7 +403,7 @@ up.util = (($) ->
|
|
403
403
|
isPresent = (object) ->
|
404
404
|
!isBlank(object)
|
405
405
|
|
406
|
-
|
406
|
+
###**
|
407
407
|
Returns whether the given argument is a function.
|
408
408
|
|
409
409
|
@function up.util.isFunction
|
@@ -414,7 +414,7 @@ up.util = (($) ->
|
|
414
414
|
isFunction = (object) ->
|
415
415
|
typeof(object) == 'function'
|
416
416
|
|
417
|
-
|
417
|
+
###**
|
418
418
|
Returns whether the given argument is a string.
|
419
419
|
|
420
420
|
@function up.util.isString
|
@@ -425,7 +425,7 @@ up.util = (($) ->
|
|
425
425
|
isString = (object) ->
|
426
426
|
typeof(object) == 'string' || object instanceof String
|
427
427
|
|
428
|
-
|
428
|
+
###**
|
429
429
|
Returns whether the given argument is a number.
|
430
430
|
|
431
431
|
Note that this will check the argument's *type*.
|
@@ -439,7 +439,7 @@ up.util = (($) ->
|
|
439
439
|
isNumber = (object) ->
|
440
440
|
typeof(object) == 'number' || object instanceof Number
|
441
441
|
|
442
|
-
|
442
|
+
###**
|
443
443
|
Returns whether the given argument is an options hash,
|
444
444
|
|
445
445
|
Differently from [`up.util.isObject()`], this returns false for
|
@@ -453,7 +453,7 @@ up.util = (($) ->
|
|
453
453
|
isOptions = (object) ->
|
454
454
|
typeof(object) == 'object' && !isNull(object) && !isJQuery(object) && !isPromise(object) && !isFormData(object) && !isArray(object)
|
455
455
|
|
456
|
-
|
456
|
+
###**
|
457
457
|
Returns whether the given argument is an object.
|
458
458
|
|
459
459
|
This also returns `true` for functions, which may behave like objects in JavaScript.
|
@@ -467,7 +467,7 @@ up.util = (($) ->
|
|
467
467
|
typeOfResult = typeof(object)
|
468
468
|
(typeOfResult == 'object' && !isNull(object)) || typeOfResult == 'function'
|
469
469
|
|
470
|
-
|
470
|
+
###**
|
471
471
|
Returns whether the given argument is a DOM element.
|
472
472
|
|
473
473
|
@function up.util.isElement
|
@@ -478,7 +478,7 @@ up.util = (($) ->
|
|
478
478
|
isElement = (object) ->
|
479
479
|
!!(object && object.nodeType == 1)
|
480
480
|
|
481
|
-
|
481
|
+
###**
|
482
482
|
Returns whether the given argument is a jQuery collection.
|
483
483
|
|
484
484
|
@function up.util.isJQuery
|
@@ -489,7 +489,7 @@ up.util = (($) ->
|
|
489
489
|
isJQuery = (object) ->
|
490
490
|
object instanceof jQuery
|
491
491
|
|
492
|
-
|
492
|
+
###**
|
493
493
|
Returns whether the given argument is an object with a `then` method.
|
494
494
|
|
495
495
|
@function up.util.isPromise
|
@@ -500,7 +500,7 @@ up.util = (($) ->
|
|
500
500
|
isPromise = (object) ->
|
501
501
|
isObject(object) && isFunction(object.then)
|
502
502
|
|
503
|
-
|
503
|
+
###**
|
504
504
|
Returns whether the given argument is an array.
|
505
505
|
|
506
506
|
@function up.util.isArray
|
@@ -511,7 +511,7 @@ up.util = (($) ->
|
|
511
511
|
# https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
|
512
512
|
isArray = Array.isArray
|
513
513
|
|
514
|
-
|
514
|
+
###**
|
515
515
|
Returns whether the given argument is a `FormData` instance.
|
516
516
|
|
517
517
|
Always returns `false` in browsers that don't support `FormData`.
|
@@ -524,7 +524,7 @@ up.util = (($) ->
|
|
524
524
|
isFormData = (object) ->
|
525
525
|
object instanceof FormData
|
526
526
|
|
527
|
-
|
527
|
+
###**
|
528
528
|
Converts the given array-like argument into an array.
|
529
529
|
|
530
530
|
Returns the array.
|
@@ -537,7 +537,7 @@ up.util = (($) ->
|
|
537
537
|
toArray = (object) ->
|
538
538
|
Array.prototype.slice.call(object)
|
539
539
|
|
540
|
-
|
540
|
+
###**
|
541
541
|
Returns a shallow copy of the given array or object.
|
542
542
|
|
543
543
|
@function up.util.copy
|
@@ -554,7 +554,7 @@ up.util = (($) ->
|
|
554
554
|
up.fail('Cannot copy %o', object)
|
555
555
|
object
|
556
556
|
|
557
|
-
|
557
|
+
###**
|
558
558
|
If given a jQuery collection, returns the underlying array of DOM element.
|
559
559
|
If given any other argument, returns the argument unchanged.
|
560
560
|
|
@@ -568,7 +568,7 @@ up.util = (($) ->
|
|
568
568
|
else
|
569
569
|
object
|
570
570
|
|
571
|
-
|
571
|
+
###**
|
572
572
|
Creates a new object by merging together the properties from the given objects.
|
573
573
|
|
574
574
|
@function up.util.merge
|
@@ -579,7 +579,7 @@ up.util = (($) ->
|
|
579
579
|
merge = (sources...) ->
|
580
580
|
assign({}, sources...)
|
581
581
|
|
582
|
-
|
582
|
+
###**
|
583
583
|
Creates an options hash from the given argument and some defaults.
|
584
584
|
|
585
585
|
The semantics of this function are confusing.
|
@@ -602,7 +602,7 @@ up.util = (($) ->
|
|
602
602
|
merged[key] = options(value, defaultValue)
|
603
603
|
merged
|
604
604
|
|
605
|
-
|
605
|
+
###**
|
606
606
|
Returns the first argument that is considered [given](/up.util.isGiven).
|
607
607
|
|
608
608
|
This function is useful when you have multiple option sources and the value can be boolean.
|
@@ -616,7 +616,7 @@ up.util = (($) ->
|
|
616
616
|
option = (args...) ->
|
617
617
|
detect(args, isGiven)
|
618
618
|
|
619
|
-
|
619
|
+
###**
|
620
620
|
Passes each element in the given array to the given function.
|
621
621
|
Returns the first element for which the function returns a truthy value.
|
622
622
|
|
@@ -636,7 +636,7 @@ up.util = (($) ->
|
|
636
636
|
break
|
637
637
|
match
|
638
638
|
|
639
|
-
|
639
|
+
###**
|
640
640
|
Returns whether the given function returns a truthy value
|
641
641
|
for any element in the given array.
|
642
642
|
|
@@ -654,7 +654,7 @@ up.util = (($) ->
|
|
654
654
|
break
|
655
655
|
match
|
656
656
|
|
657
|
-
|
657
|
+
###**
|
658
658
|
Returns whether the given function returns a truthy value
|
659
659
|
for all elements in the given array.
|
660
660
|
|
@@ -672,7 +672,7 @@ up.util = (($) ->
|
|
672
672
|
break
|
673
673
|
match
|
674
674
|
|
675
|
-
|
675
|
+
###**
|
676
676
|
Returns all elements from the given array that are
|
677
677
|
neither `null` or `undefined`.
|
678
678
|
|
@@ -684,7 +684,7 @@ up.util = (($) ->
|
|
684
684
|
compact = (array) ->
|
685
685
|
select array, isGiven
|
686
686
|
|
687
|
-
|
687
|
+
###**
|
688
688
|
Returns the given array without duplicates.
|
689
689
|
|
690
690
|
@function up.util.uniq
|
@@ -700,7 +700,7 @@ up.util = (($) ->
|
|
700
700
|
else
|
701
701
|
seen[element] = true
|
702
702
|
|
703
|
-
|
703
|
+
###**
|
704
704
|
Returns all elements from the given array that return
|
705
705
|
a truthy value when passed to the given function.
|
706
706
|
|
@@ -716,7 +716,7 @@ up.util = (($) ->
|
|
716
716
|
matches.push(element)
|
717
717
|
matches
|
718
718
|
|
719
|
-
|
719
|
+
###**
|
720
720
|
Returns all elements from the given array that do not return
|
721
721
|
a truthy value when passed to the given function.
|
722
722
|
|
@@ -728,7 +728,7 @@ up.util = (($) ->
|
|
728
728
|
reject = (array, tester) ->
|
729
729
|
select(array, (element) -> !tester(element))
|
730
730
|
|
731
|
-
|
731
|
+
###**
|
732
732
|
Returns the intersection of the given two arrays.
|
733
733
|
|
734
734
|
Implementation is not optimized. Don't use it for large arrays.
|
@@ -740,7 +740,7 @@ up.util = (($) ->
|
|
740
740
|
select array1, (element) ->
|
741
741
|
contains(array2, element)
|
742
742
|
|
743
|
-
|
743
|
+
###**
|
744
744
|
Returns the first [present](/up.util.isPresent) element attribute
|
745
745
|
among the given list of attribute names.
|
746
746
|
|
@@ -751,7 +751,7 @@ up.util = (($) ->
|
|
751
751
|
values = ($element.attr(attrName) for attrName in attrNames)
|
752
752
|
detect(values, isPresent)
|
753
753
|
|
754
|
-
|
754
|
+
###**
|
755
755
|
Waits for the given number of milliseconds, the runs the given callback.
|
756
756
|
|
757
757
|
Instead of `up.util.setTimer(0, fn)` you can also use [`up.util.nextFrame(fn)`](/up.util.nextFrame).
|
@@ -764,7 +764,7 @@ up.util = (($) ->
|
|
764
764
|
setTimer = (millis, callback) ->
|
765
765
|
setTimeout(callback, millis)
|
766
766
|
|
767
|
-
|
767
|
+
###**
|
768
768
|
Schedules the given function to be called in the
|
769
769
|
next JavaScript execution frame.
|
770
770
|
|
@@ -775,7 +775,7 @@ up.util = (($) ->
|
|
775
775
|
nextFrame = (block) ->
|
776
776
|
setTimeout(block, 0)
|
777
777
|
|
778
|
-
|
778
|
+
###**
|
779
779
|
Queue a function to be executed in the next microtask.
|
780
780
|
|
781
781
|
@function up.util.queueMicrotask
|
@@ -785,7 +785,7 @@ up.util = (($) ->
|
|
785
785
|
microtask = (task) ->
|
786
786
|
Promise.resolve().then(task)
|
787
787
|
|
788
|
-
|
788
|
+
###**
|
789
789
|
Returns the last element of the given array.
|
790
790
|
|
791
791
|
@function up.util.last
|
@@ -795,7 +795,7 @@ up.util = (($) ->
|
|
795
795
|
last = (array) ->
|
796
796
|
array[array.length - 1]
|
797
797
|
|
798
|
-
|
798
|
+
###**
|
799
799
|
Measures the drawable area of the document.
|
800
800
|
|
801
801
|
@function up.util.clientSize
|
@@ -806,7 +806,7 @@ up.util = (($) ->
|
|
806
806
|
width: element.clientWidth
|
807
807
|
height: element.clientHeight
|
808
808
|
|
809
|
-
|
809
|
+
###**
|
810
810
|
Returns the width of a scrollbar.
|
811
811
|
|
812
812
|
This only runs once per page load.
|
@@ -832,7 +832,7 @@ up.util = (($) ->
|
|
832
832
|
$outer.remove()
|
833
833
|
width
|
834
834
|
|
835
|
-
|
835
|
+
###**
|
836
836
|
Returns whether the given element is currently showing a vertical scrollbar.
|
837
837
|
|
838
838
|
@function up.util.documentHasVerticalScrollbar
|
@@ -850,7 +850,7 @@ up.util = (($) ->
|
|
850
850
|
|
851
851
|
forcedScroll || (!forcedHidden && html.scrollHeight > html.clientHeight)
|
852
852
|
|
853
|
-
|
853
|
+
###**
|
854
854
|
Modifies the given function so it only runs once.
|
855
855
|
Subsequent calls will return the previous return value.
|
856
856
|
|
@@ -865,7 +865,7 @@ up.util = (($) ->
|
|
865
865
|
fun = undefined
|
866
866
|
result
|
867
867
|
|
868
|
-
|
868
|
+
###**
|
869
869
|
Temporarily sets the CSS for the given element.
|
870
870
|
|
871
871
|
@function up.util.temporaryCss
|
@@ -889,7 +889,7 @@ up.util = (($) ->
|
|
889
889
|
else
|
890
890
|
once(memo)
|
891
891
|
|
892
|
-
|
892
|
+
###**
|
893
893
|
Forces the given jQuery element into an accelerated compositing layer.
|
894
894
|
|
895
895
|
@function up.util.forceCompositing
|
@@ -908,7 +908,7 @@ up.util = (($) ->
|
|
908
908
|
memo = ->
|
909
909
|
memo
|
910
910
|
|
911
|
-
|
911
|
+
###**
|
912
912
|
Forces a repaint of the given element.
|
913
913
|
|
914
914
|
@function up.util.forceRepaint
|
@@ -920,7 +920,7 @@ up.util = (($) ->
|
|
920
920
|
|
921
921
|
cssAnimate = (elementOrSelector, lastFrame, opts) ->
|
922
922
|
|
923
|
-
|
923
|
+
###**
|
924
924
|
@internal
|
925
925
|
###
|
926
926
|
margins = (selectorOrElement) ->
|
@@ -931,7 +931,7 @@ up.util = (($) ->
|
|
931
931
|
bottom: parseFloat(withUnits['margin-bottom'])
|
932
932
|
left: parseFloat(withUnits['margin-left'])
|
933
933
|
|
934
|
-
|
934
|
+
###**
|
935
935
|
Measures the given element.
|
936
936
|
|
937
937
|
@function up.util.measure
|
@@ -978,7 +978,7 @@ up.util = (($) ->
|
|
978
978
|
|
979
979
|
box
|
980
980
|
|
981
|
-
|
981
|
+
###**
|
982
982
|
Copies all attributes from the source element to the target element.
|
983
983
|
|
984
984
|
@function up.util.copyAttributes
|
@@ -989,7 +989,7 @@ up.util = (($) ->
|
|
989
989
|
if attr.specified
|
990
990
|
$target.attr(attr.name, attr.value)
|
991
991
|
|
992
|
-
|
992
|
+
###**
|
993
993
|
Looks for the given selector in the element and its descendants.
|
994
994
|
|
995
995
|
@function up.util.selectInSubtree
|
@@ -998,7 +998,7 @@ up.util = (($) ->
|
|
998
998
|
selectInSubtree = ($element, selector) ->
|
999
999
|
$element.find(selector).addBack(selector)
|
1000
1000
|
|
1001
|
-
|
1001
|
+
###**
|
1002
1002
|
Looks for the given selector in the element, its descendants and its ancestors.
|
1003
1003
|
|
1004
1004
|
@function up.util.selectInDynasty
|
@@ -1009,7 +1009,7 @@ up.util = (($) ->
|
|
1009
1009
|
$ancestors = $element.parents(selector)
|
1010
1010
|
$subtree.add($ancestors)
|
1011
1011
|
|
1012
|
-
|
1012
|
+
###**
|
1013
1013
|
Returns whether the given keyboard event involved the ESC key.
|
1014
1014
|
|
1015
1015
|
@function up.util.escapePressed
|
@@ -1018,7 +1018,7 @@ up.util = (($) ->
|
|
1018
1018
|
escapePressed = (event) ->
|
1019
1019
|
event.keyCode == 27
|
1020
1020
|
|
1021
|
-
|
1021
|
+
###**
|
1022
1022
|
Returns whether the given array or string contains the given element or substring.
|
1023
1023
|
|
1024
1024
|
@function up.util.contains
|
@@ -1029,7 +1029,7 @@ up.util = (($) ->
|
|
1029
1029
|
contains = (arrayOrString, elementOrSubstring) ->
|
1030
1030
|
arrayOrString.indexOf(elementOrSubstring) >= 0
|
1031
1031
|
|
1032
|
-
|
1032
|
+
###**
|
1033
1033
|
@function up.util.castedAttr
|
1034
1034
|
@internal
|
1035
1035
|
###
|
@@ -1046,7 +1046,7 @@ up.util = (($) ->
|
|
1046
1046
|
# castsToFalse = (object) ->
|
1047
1047
|
# String(object) == "false"
|
1048
1048
|
|
1049
|
-
|
1049
|
+
###**
|
1050
1050
|
Returns a copy of the given object that only contains
|
1051
1051
|
the given properties.
|
1052
1052
|
|
@@ -1062,7 +1062,7 @@ up.util = (($) ->
|
|
1062
1062
|
filtered[property] = object[property]
|
1063
1063
|
filtered
|
1064
1064
|
|
1065
|
-
|
1065
|
+
###**
|
1066
1066
|
Returns a copy of the given object that contains all except
|
1067
1067
|
the given properties.
|
1068
1068
|
|
@@ -1077,14 +1077,14 @@ up.util = (($) ->
|
|
1077
1077
|
delete filtered[property]
|
1078
1078
|
filtered
|
1079
1079
|
|
1080
|
-
|
1080
|
+
###**
|
1081
1081
|
@function up.util.isUnmodifiedKeyEvent
|
1082
1082
|
@internal
|
1083
1083
|
###
|
1084
1084
|
isUnmodifiedKeyEvent = (event) ->
|
1085
1085
|
not (event.metaKey or event.shiftKey or event.ctrlKey)
|
1086
1086
|
|
1087
|
-
|
1087
|
+
###**
|
1088
1088
|
@function up.util.isUnmodifiedMouseEvent
|
1089
1089
|
@internal
|
1090
1090
|
###
|
@@ -1092,7 +1092,7 @@ up.util = (($) ->
|
|
1092
1092
|
isLeftButton = isUndefined(event.button) || event.button == 0
|
1093
1093
|
isLeftButton && isUnmodifiedKeyEvent(event)
|
1094
1094
|
|
1095
|
-
|
1095
|
+
###**
|
1096
1096
|
Returns a promise that will never be resolved.
|
1097
1097
|
|
1098
1098
|
@function up.util.unresolvablePromise
|
@@ -1101,7 +1101,7 @@ up.util = (($) ->
|
|
1101
1101
|
unresolvablePromise = ->
|
1102
1102
|
new Promise(noop)
|
1103
1103
|
|
1104
|
-
|
1104
|
+
###**
|
1105
1105
|
Returns an empty jQuery collection.
|
1106
1106
|
|
1107
1107
|
@function up.util.nullJQuery
|
@@ -1110,7 +1110,7 @@ up.util = (($) ->
|
|
1110
1110
|
nullJQuery = ->
|
1111
1111
|
$()
|
1112
1112
|
|
1113
|
-
|
1113
|
+
###**
|
1114
1114
|
On the given element, set attributes that are still missing.
|
1115
1115
|
|
1116
1116
|
@function up.util.setMissingAttrs
|
@@ -1121,7 +1121,7 @@ up.util = (($) ->
|
|
1121
1121
|
if isMissing($element.attr(key))
|
1122
1122
|
$element.attr(key, value)
|
1123
1123
|
|
1124
|
-
|
1124
|
+
###**
|
1125
1125
|
Removes the given element from the given array.
|
1126
1126
|
|
1127
1127
|
This changes the given array.
|
@@ -1137,7 +1137,7 @@ up.util = (($) ->
|
|
1137
1137
|
array.splice(index, 1)
|
1138
1138
|
element
|
1139
1139
|
|
1140
|
-
|
1140
|
+
###**
|
1141
1141
|
@function up.util.multiSelector
|
1142
1142
|
@internal
|
1143
1143
|
###
|
@@ -1194,7 +1194,7 @@ up.util = (($) ->
|
|
1194
1194
|
|
1195
1195
|
obj
|
1196
1196
|
|
1197
|
-
|
1197
|
+
###**
|
1198
1198
|
If the given `value` is a function, calls the function with the given `args`.
|
1199
1199
|
Otherwise it just returns `value`.
|
1200
1200
|
|
@@ -1207,7 +1207,7 @@ up.util = (($) ->
|
|
1207
1207
|
else
|
1208
1208
|
value
|
1209
1209
|
|
1210
|
-
|
1210
|
+
###**
|
1211
1211
|
@function up.util.config
|
1212
1212
|
@param {Object|Function} blueprint
|
1213
1213
|
Default configuration options.
|
@@ -1221,7 +1221,7 @@ up.util = (($) ->
|
|
1221
1221
|
Object.preventExtensions(hash)
|
1222
1222
|
hash
|
1223
1223
|
|
1224
|
-
|
1224
|
+
###**
|
1225
1225
|
@function up.util.openConfig
|
1226
1226
|
@internal
|
1227
1227
|
###
|
@@ -1234,7 +1234,7 @@ up.util = (($) ->
|
|
1234
1234
|
hash.reset()
|
1235
1235
|
hash
|
1236
1236
|
|
1237
|
-
|
1237
|
+
###**
|
1238
1238
|
@function up.util.unwrapElement
|
1239
1239
|
@internal
|
1240
1240
|
###
|
@@ -1246,7 +1246,7 @@ up.util = (($) ->
|
|
1246
1246
|
parent.insertBefore(wrappedNode, wrapper)
|
1247
1247
|
parent.removeChild(wrapper)
|
1248
1248
|
|
1249
|
-
|
1249
|
+
###**
|
1250
1250
|
@function up.util.offsetParent
|
1251
1251
|
@internal
|
1252
1252
|
###
|
@@ -1259,7 +1259,7 @@ up.util = (($) ->
|
|
1259
1259
|
break
|
1260
1260
|
$match
|
1261
1261
|
|
1262
|
-
|
1262
|
+
###**
|
1263
1263
|
Returns if the given element has a `fixed` position.
|
1264
1264
|
|
1265
1265
|
@function up.util.isFixed
|
@@ -1276,7 +1276,7 @@ up.util = (($) ->
|
|
1276
1276
|
if $element.length == 0 || $element.is(document)
|
1277
1277
|
return false
|
1278
1278
|
|
1279
|
-
|
1279
|
+
###**
|
1280
1280
|
@function up.util.fixedToAbsolute
|
1281
1281
|
@internal
|
1282
1282
|
###
|
@@ -1303,7 +1303,7 @@ up.util = (($) ->
|
|
1303
1303
|
# else
|
1304
1304
|
# error('Could not parse argument names of %o', fun)
|
1305
1305
|
|
1306
|
-
|
1306
|
+
###**
|
1307
1307
|
Normalizes the given params object to the form returned by
|
1308
1308
|
[`jQuery.serializeArray`](https://api.jquery.com/serializeArray/).
|
1309
1309
|
|
@@ -1330,7 +1330,7 @@ up.util = (($) ->
|
|
1330
1330
|
value: decodeURIComponent(pair[1])
|
1331
1331
|
array
|
1332
1332
|
|
1333
|
-
|
1333
|
+
###**
|
1334
1334
|
Returns an URL-encoded query string for the given params object.
|
1335
1335
|
|
1336
1336
|
The returned string does **not** include a leading `?` character.
|
@@ -1370,7 +1370,7 @@ up.util = (($) ->
|
|
1370
1370
|
else
|
1371
1371
|
$form.find(submitButtonSelector).first()
|
1372
1372
|
|
1373
|
-
|
1373
|
+
###**
|
1374
1374
|
Serializes the given form into a request data representation.
|
1375
1375
|
|
1376
1376
|
@function up.util.requestDataFromForm
|
@@ -1394,7 +1394,7 @@ up.util = (($) ->
|
|
1394
1394
|
data
|
1395
1395
|
|
1396
1396
|
|
1397
|
-
|
1397
|
+
###**
|
1398
1398
|
Adds a key/value pair to the given request data representation.
|
1399
1399
|
|
1400
1400
|
This mutates the given `data` if `data` is a `FormData`, an object
|
@@ -1421,7 +1421,7 @@ up.util = (($) ->
|
|
1421
1421
|
data = [data, newPair].join('&')
|
1422
1422
|
data
|
1423
1423
|
|
1424
|
-
|
1424
|
+
###**
|
1425
1425
|
Merges the request data in `source` into `target`.
|
1426
1426
|
Will modify the passed-in `target`.
|
1427
1427
|
|
@@ -1433,7 +1433,7 @@ up.util = (($) ->
|
|
1433
1433
|
target = appendRequestData(target, field.name, field.value)
|
1434
1434
|
target
|
1435
1435
|
|
1436
|
-
|
1436
|
+
###**
|
1437
1437
|
Throws a [JavaScript error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)
|
1438
1438
|
with the given message.
|
1439
1439
|
|
@@ -1477,7 +1477,7 @@ up.util = (($) ->
|
|
1477
1477
|
">": ">"
|
1478
1478
|
'"': '"'
|
1479
1479
|
|
1480
|
-
|
1480
|
+
###**
|
1481
1481
|
Escapes the given string of HTML by replacing control chars with their HTML entities.
|
1482
1482
|
|
1483
1483
|
@function up.util.escapeHtml
|
@@ -1524,7 +1524,7 @@ up.util = (($) ->
|
|
1524
1524
|
|
1525
1525
|
identity = (arg) -> arg
|
1526
1526
|
|
1527
|
-
|
1527
|
+
###**
|
1528
1528
|
Returns whether the given element has been detached from the DOM
|
1529
1529
|
(or whether it was never attached).
|
1530
1530
|
|
@@ -1536,7 +1536,7 @@ up.util = (($) ->
|
|
1536
1536
|
# This is by far the fastest way to do this
|
1537
1537
|
not jQuery.contains(document.documentElement, element)
|
1538
1538
|
|
1539
|
-
|
1539
|
+
###**
|
1540
1540
|
Given a function that will return a promise, returns a proxy function
|
1541
1541
|
with an additional `.promise` attribute.
|
1542
1542
|
|
@@ -1561,7 +1561,7 @@ up.util = (($) ->
|
|
1561
1561
|
preview.promise = deferred.promise()
|
1562
1562
|
preview
|
1563
1563
|
|
1564
|
-
|
1564
|
+
###**
|
1565
1565
|
A linear task queue whose (2..n)th tasks can be changed at any time.
|
1566
1566
|
|
1567
1567
|
@function up.util.DivertibleChain
|
@@ -1599,7 +1599,7 @@ up.util = (($) ->
|
|
1599
1599
|
@poke()
|
1600
1600
|
@promise()
|
1601
1601
|
|
1602
|
-
|
1602
|
+
###**
|
1603
1603
|
@function up.util.submittedValue
|
1604
1604
|
@internal
|
1605
1605
|
###
|
@@ -1610,7 +1610,7 @@ up.util = (($) ->
|
|
1610
1610
|
else
|
1611
1611
|
$field.val()
|
1612
1612
|
|
1613
|
-
|
1613
|
+
###**
|
1614
1614
|
@function up.util.sequence
|
1615
1615
|
@param {Array<Function>} functions...
|
1616
1616
|
@return {Function}
|
@@ -1622,7 +1622,7 @@ up.util = (($) ->
|
|
1622
1622
|
->
|
1623
1623
|
map functions, (f) -> f()
|
1624
1624
|
|
1625
|
-
#
|
1625
|
+
# ###**
|
1626
1626
|
# @function up.util.race
|
1627
1627
|
# @internal
|
1628
1628
|
# ###
|
@@ -1632,7 +1632,7 @@ up.util = (($) ->
|
|
1632
1632
|
# promise.then -> raceDone.resolve()
|
1633
1633
|
# raceDone.promise()
|
1634
1634
|
|
1635
|
-
|
1635
|
+
###**
|
1636
1636
|
@function up.util.promiseTimer
|
1637
1637
|
@internal
|
1638
1638
|
###
|
@@ -1643,7 +1643,7 @@ up.util = (($) ->
|
|
1643
1643
|
promise.cancel = -> clearTimeout(timeout)
|
1644
1644
|
promise
|
1645
1645
|
|
1646
|
-
|
1646
|
+
###**
|
1647
1647
|
Returns `'left'` if the center of the given element is in the left 50% of the screen.
|
1648
1648
|
Otherwise returns `'right'`.
|
1649
1649
|
|
@@ -1660,7 +1660,7 @@ up.util = (($) ->
|
|
1660
1660
|
else
|
1661
1661
|
'right'
|
1662
1662
|
|
1663
|
-
|
1663
|
+
###**
|
1664
1664
|
Like `$old.replaceWith($new)`, but keeps event handlers bound to `$old`.
|
1665
1665
|
|
1666
1666
|
Note that this is a memory leak unless you re-attach `$old` to the DOM aferwards.
|
@@ -1675,7 +1675,7 @@ up.util = (($) ->
|
|
1675
1675
|
$insertion.replaceWith($new)
|
1676
1676
|
$old
|
1677
1677
|
|
1678
|
-
|
1678
|
+
###**
|
1679
1679
|
Flattens the given `array` a single level deep.
|
1680
1680
|
|
1681
1681
|
@function up.util.flatten
|
@@ -1694,7 +1694,7 @@ up.util = (($) ->
|
|
1694
1694
|
flattened.push(object)
|
1695
1695
|
flattened
|
1696
1696
|
|
1697
|
-
|
1697
|
+
###**
|
1698
1698
|
Returns whether the given value is truthy.
|
1699
1699
|
|
1700
1700
|
@function up.util.isTruthy
|
@@ -1703,7 +1703,7 @@ up.util = (($) ->
|
|
1703
1703
|
isTruthy = (object) ->
|
1704
1704
|
!!object
|
1705
1705
|
|
1706
|
-
|
1706
|
+
###**
|
1707
1707
|
Sets the given callback as both fulfillment and rejection handler for the given promise.
|
1708
1708
|
|
1709
1709
|
@function up.util.always
|
@@ -1712,7 +1712,7 @@ up.util = (($) ->
|
|
1712
1712
|
always = (promise, callback) ->
|
1713
1713
|
promise.then(callback, callback)
|
1714
1714
|
|
1715
|
-
|
1715
|
+
###**
|
1716
1716
|
# Registers an empty rejection handler with the given promise.
|
1717
1717
|
# This prevents browsers from printing "Uncaught (in promise)" to the error
|
1718
1718
|
# console when the promise is rejection.
|
@@ -1734,7 +1734,7 @@ up.util = (($) ->
|
|
1734
1734
|
muteRejection = (promise) ->
|
1735
1735
|
promise?.catch(noop)
|
1736
1736
|
|
1737
|
-
|
1737
|
+
###**
|
1738
1738
|
@function up.util.newDeferred
|
1739
1739
|
@internal
|
1740
1740
|
###
|
@@ -1749,7 +1749,7 @@ up.util = (($) ->
|
|
1749
1749
|
nativePromise.promise = -> nativePromise # just return self
|
1750
1750
|
nativePromise
|
1751
1751
|
|
1752
|
-
|
1752
|
+
###**
|
1753
1753
|
Calls the given block. If the block throws an exception,
|
1754
1754
|
a rejected promise is returned instead.
|
1755
1755
|
|
@@ -1762,7 +1762,7 @@ up.util = (($) ->
|
|
1762
1762
|
catch error
|
1763
1763
|
Promise.reject(error)
|
1764
1764
|
|
1765
|
-
|
1765
|
+
###**
|
1766
1766
|
Returns whether the given element is a descendant of the `<body>` element.
|
1767
1767
|
|
1768
1768
|
@function up.util.isBodyDescendant
|