unpoly-rails 0.54.0 → 0.54.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
|
Application layout
|
3
3
|
==================
|
4
4
|
|
@@ -22,7 +22,7 @@ up.layout = (($) ->
|
|
22
22
|
|
23
23
|
u = up.util
|
24
24
|
|
25
|
-
|
25
|
+
###**
|
26
26
|
Configures the application layout.
|
27
27
|
|
28
28
|
@property up.layout.config
|
@@ -76,7 +76,7 @@ up.layout = (($) ->
|
|
76
76
|
lastScrollTops.clear()
|
77
77
|
scrollingTracker.finish()
|
78
78
|
|
79
|
-
|
79
|
+
###**
|
80
80
|
Scrolls the given viewport to the given Y-position.
|
81
81
|
|
82
82
|
A "viewport" is an element that has scrollbars, e.g. `<body>` or
|
@@ -152,7 +152,7 @@ up.layout = (($) ->
|
|
152
152
|
$scrollable.scrollTop(scrollTop)
|
153
153
|
Promise.resolve()
|
154
154
|
|
155
|
-
|
155
|
+
###**
|
156
156
|
Finishes scrolling animations in the given element, its ancestors or its descendants.
|
157
157
|
|
158
158
|
@function up.layout.finishScrolling
|
@@ -164,14 +164,14 @@ up.layout = (($) ->
|
|
164
164
|
$scrollable = scrollableElementForViewport(element)
|
165
165
|
scrollingTracker.finish($scrollable)
|
166
166
|
|
167
|
-
|
167
|
+
###**
|
168
168
|
@function up.layout.anchoredRight
|
169
169
|
@internal
|
170
170
|
###
|
171
171
|
anchoredRight = ->
|
172
172
|
u.multiSelector(config.anchoredRight).select()
|
173
173
|
|
174
|
-
|
174
|
+
###**
|
175
175
|
@function measureObstruction
|
176
176
|
@return {Object}
|
177
177
|
@internal
|
@@ -193,7 +193,7 @@ up.layout = (($) ->
|
|
193
193
|
top: Math.max(0, fixedTopBottoms...)
|
194
194
|
bottom: Math.max(0, fixedBottomTops...)
|
195
195
|
|
196
|
-
|
196
|
+
###**
|
197
197
|
Scroll's the given element's viewport so the first rows of the
|
198
198
|
element are visible for the user.
|
199
199
|
|
@@ -292,7 +292,7 @@ up.layout = (($) ->
|
|
292
292
|
else
|
293
293
|
Promise.resolve()
|
294
294
|
|
295
|
-
|
295
|
+
###**
|
296
296
|
[Reveals](/up.reveal) an element matching the `#hash` in the current URL.
|
297
297
|
|
298
298
|
Other than the default behavior found in browsers, `up.revealHash` works with
|
@@ -315,7 +315,7 @@ up.layout = (($) ->
|
|
315
315
|
viewportSelector = ->
|
316
316
|
u.multiSelector(config.viewports)
|
317
317
|
|
318
|
-
|
318
|
+
###**
|
319
319
|
Returns the viewport for the given element.
|
320
320
|
|
321
321
|
Throws an error if no viewport could be found.
|
@@ -331,7 +331,7 @@ up.layout = (($) ->
|
|
331
331
|
up.fail("Could not find viewport for %o", $element)
|
332
332
|
$viewport
|
333
333
|
|
334
|
-
|
334
|
+
###**
|
335
335
|
Returns a jQuery collection of all the viewports contained within the
|
336
336
|
given selector or element.
|
337
337
|
|
@@ -344,7 +344,7 @@ up.layout = (($) ->
|
|
344
344
|
$element = $(selectorOrElement)
|
345
345
|
viewportSelector().selectInSubtree($element)
|
346
346
|
|
347
|
-
|
347
|
+
###**
|
348
348
|
Returns a jQuery collection of all the viewports on the screen.
|
349
349
|
|
350
350
|
@function up.layout.viewports
|
@@ -360,7 +360,7 @@ up.layout = (($) ->
|
|
360
360
|
else
|
361
361
|
u.selectorForElement($viewport)
|
362
362
|
|
363
|
-
|
363
|
+
###**
|
364
364
|
Returns a hash with scroll positions.
|
365
365
|
|
366
366
|
Each key in the hash is a viewport selector. The corresponding
|
@@ -383,7 +383,7 @@ up.layout = (($) ->
|
|
383
383
|
topsBySelector[key] = top
|
384
384
|
topsBySelector
|
385
385
|
|
386
|
-
|
386
|
+
###**
|
387
387
|
@function up.layout.fixedChildren
|
388
388
|
@internal
|
389
389
|
###
|
@@ -395,7 +395,7 @@ up.layout = (($) ->
|
|
395
395
|
$elements = $elements.add($root.find(config.fixedBottom.join(', '))) if u.isPresent(config.fixedBottom)
|
396
396
|
$elements
|
397
397
|
|
398
|
-
|
398
|
+
###**
|
399
399
|
Saves the top scroll positions of all the
|
400
400
|
viewports configured in [`up.layout.config.viewports`](/up.layout.config).
|
401
401
|
|
@@ -415,7 +415,7 @@ up.layout = (($) ->
|
|
415
415
|
tops = u.option(options.tops, scrollTops())
|
416
416
|
lastScrollTops.set(url, tops)
|
417
417
|
|
418
|
-
|
418
|
+
###**
|
419
419
|
Restores [previously saved](/up.layout.saveScroll) scroll positions of viewports
|
420
420
|
viewports configured in [`up.layout.config.viewports`](/up.layout.config).
|
421
421
|
|
@@ -452,7 +452,7 @@ up.layout = (($) ->
|
|
452
452
|
|
453
453
|
Promise.all(allScrollPromises)
|
454
454
|
|
455
|
-
|
455
|
+
###**
|
456
456
|
@function up.layout.revealOrRestoreScroll
|
457
457
|
@param {boolean} [options.restoreScroll]
|
458
458
|
@param {boolean|string} [options.reveal]
|
@@ -486,7 +486,7 @@ up.layout = (($) ->
|
|
486
486
|
# to fulfill this function's signature.
|
487
487
|
return Promise.resolve()
|
488
488
|
|
489
|
-
|
489
|
+
###**
|
490
490
|
@internal
|
491
491
|
###
|
492
492
|
revealSelector = (selector, options) ->
|
@@ -497,7 +497,7 @@ up.layout = (($) ->
|
|
497
497
|
selector += ", a[name='#{selector}']"
|
498
498
|
selector
|
499
499
|
|
500
|
-
|
500
|
+
###**
|
501
501
|
Marks this element as a scrolling container ("viewport").
|
502
502
|
|
503
503
|
Apply this attribute if your app uses a custom panel layout with fixed positioning
|
@@ -550,7 +550,7 @@ up.layout = (($) ->
|
|
550
550
|
@stable
|
551
551
|
###
|
552
552
|
|
553
|
-
|
553
|
+
###**
|
554
554
|
Marks this element as being fixed to the top edge of the screen
|
555
555
|
using `position: fixed`.
|
556
556
|
|
@@ -570,7 +570,7 @@ up.layout = (($) ->
|
|
570
570
|
@stable
|
571
571
|
###
|
572
572
|
|
573
|
-
|
573
|
+
###**
|
574
574
|
Marks this element as being fixed to the bottom edge of the screen
|
575
575
|
using `position: fixed`.
|
576
576
|
|
@@ -591,7 +591,7 @@ up.layout = (($) ->
|
|
591
591
|
###
|
592
592
|
|
593
593
|
|
594
|
-
|
594
|
+
###**
|
595
595
|
Marks this element as being anchored to the right edge of the screen,
|
596
596
|
typically fixed navigation bars.
|
597
597
|
|
@@ -626,7 +626,7 @@ up.layout = (($) ->
|
|
626
626
|
@stable
|
627
627
|
###
|
628
628
|
|
629
|
-
|
629
|
+
###**
|
630
630
|
@function up.layout.firstHashTarget
|
631
631
|
@internal
|
632
632
|
###
|
@@ -638,7 +638,7 @@ up.layout = (($) ->
|
|
638
638
|
|
639
639
|
up.on 'up:framework:reset', reset
|
640
640
|
|
641
|
-
knife: eval(Knife
|
641
|
+
<% if ENV['JS_KNIFE'] %>knife: eval(Knife.point)<% end %>
|
642
642
|
reveal: reveal
|
643
643
|
revealHash: revealHash
|
644
644
|
firstHashTarget: firstHashTarget
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
###**
|
2
2
|
Linking to fragments
|
3
3
|
====================
|
4
4
|
|
@@ -71,7 +71,7 @@ up.link = (($) ->
|
|
71
71
|
|
72
72
|
u = up.util
|
73
73
|
|
74
|
-
|
74
|
+
###**
|
75
75
|
Visits the given URL without a full page load.
|
76
76
|
This is done by fetching `url` through an AJAX request
|
77
77
|
and [replacing](/up.replace) the current `<body>` element with the response's `<body>` element.
|
@@ -94,7 +94,7 @@ up.link = (($) ->
|
|
94
94
|
selector = u.option(options.target, 'body')
|
95
95
|
up.replace(selector, url, options)
|
96
96
|
|
97
|
-
|
97
|
+
###**
|
98
98
|
Follows the given link via AJAX and [replaces](/up.replace) the current page
|
99
99
|
with HTML from the response.
|
100
100
|
|
@@ -142,7 +142,7 @@ up.link = (($) ->
|
|
142
142
|
variant = followVariantForLink($link)
|
143
143
|
variant.followLink($link, options)
|
144
144
|
|
145
|
-
|
145
|
+
###**
|
146
146
|
This event is [emitted](/up.emit) when a link is [followed](/up.follow) through Unpoly.
|
147
147
|
|
148
148
|
@event up:link:follow
|
@@ -153,7 +153,7 @@ up.link = (($) ->
|
|
153
153
|
@stable
|
154
154
|
###
|
155
155
|
|
156
|
-
|
156
|
+
###**
|
157
157
|
@function defaultFollow
|
158
158
|
@internal
|
159
159
|
###
|
@@ -188,7 +188,7 @@ up.link = (($) ->
|
|
188
188
|
options.preload = true
|
189
189
|
defaultFollow($link, options)
|
190
190
|
|
191
|
-
|
191
|
+
###**
|
192
192
|
Returns the HTTP method that should be used when following the given link.
|
193
193
|
|
194
194
|
Looks at the link's `up-method` or `data-method` attribute.
|
@@ -204,7 +204,7 @@ up.link = (($) ->
|
|
204
204
|
options = u.options(options)
|
205
205
|
u.option(options.method, $link.attr('up-method'), $link.attr('data-method'), 'get').toUpperCase()
|
206
206
|
|
207
|
-
|
207
|
+
###**
|
208
208
|
No-op that is called when we allow a browser's default action to go through,
|
209
209
|
so we can spy on it in unit tests. See `link_spec.js`.
|
210
210
|
|
@@ -215,7 +215,7 @@ up.link = (($) ->
|
|
215
215
|
|
216
216
|
followVariants = []
|
217
217
|
|
218
|
-
|
218
|
+
###**
|
219
219
|
Registers the given handler for links with the given selector.
|
220
220
|
|
221
221
|
This does more than a simple `click` handler:
|
@@ -236,7 +236,7 @@ up.link = (($) ->
|
|
236
236
|
variant.registerEvents()
|
237
237
|
variant
|
238
238
|
|
239
|
-
|
239
|
+
###**
|
240
240
|
Returns whether the given link will be handled by Unpoly instead of making a full page load.
|
241
241
|
|
242
242
|
A link will be handled by Unpoly if it has an attribute
|
@@ -250,7 +250,7 @@ up.link = (($) ->
|
|
250
250
|
isFollowable = (link) ->
|
251
251
|
!!followVariantForLink(link, default: false)
|
252
252
|
|
253
|
-
|
253
|
+
###**
|
254
254
|
Returns the handler function that can be used to follow the given link.
|
255
255
|
E.g. it wil return a handler calling `up.modal.follow` if the link is a `[up-modal]`,
|
256
256
|
but a handler calling `up.link.follow` if the links is `[up-target]`.
|
@@ -266,7 +266,7 @@ up.link = (($) ->
|
|
266
266
|
variant ||= DEFAULT_FOLLOW_VARIANT unless options.default is false
|
267
267
|
variant
|
268
268
|
|
269
|
-
|
269
|
+
###**
|
270
270
|
Makes sure that the given link will be handled by Unpoly instead of making a full page load.
|
271
271
|
|
272
272
|
This is done by giving the link an `up-follow` attribute
|
@@ -288,7 +288,7 @@ up.link = (($) ->
|
|
288
288
|
$targetedInput = up.form.fieldSelector().seekUp($target)
|
289
289
|
$targetedChildLink.length == 0 && $targetedInput.length == 0 && u.isUnmodifiedMouseEvent(event)
|
290
290
|
|
291
|
-
|
291
|
+
###**
|
292
292
|
Returns whether the given link has a [safe](https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.1)
|
293
293
|
HTTP method like `GET`.
|
294
294
|
|
@@ -300,7 +300,7 @@ up.link = (($) ->
|
|
300
300
|
method = followMethod($link, options)
|
301
301
|
up.proxy.isSafeMethod(method)
|
302
302
|
|
303
|
-
|
303
|
+
###**
|
304
304
|
Follows this link via AJAX and replaces a CSS selector in the current page
|
305
305
|
with corresponding elements from a new page fetched from the server:
|
306
306
|
|
@@ -410,7 +410,7 @@ up.link = (($) ->
|
|
410
410
|
follow: ($link, options) -> defaultFollow($link, options)
|
411
411
|
preload: ($link, options) -> defaultPreload($link, options)
|
412
412
|
|
413
|
-
|
413
|
+
###**
|
414
414
|
If applied on a link, follows this link via AJAX and replaces the
|
415
415
|
current `<body>` element with the response's `<body>` element.
|
416
416
|
|
@@ -461,7 +461,7 @@ up.link = (($) ->
|
|
461
461
|
@stable
|
462
462
|
###
|
463
463
|
|
464
|
-
|
464
|
+
###**
|
465
465
|
By adding an `up-instant` attribute to a link, the destination will be
|
466
466
|
fetched on `mousedown` instead of `click` (`mouseup`).
|
467
467
|
|
@@ -483,7 +483,7 @@ up.link = (($) ->
|
|
483
483
|
@stable
|
484
484
|
###
|
485
485
|
|
486
|
-
|
486
|
+
###**
|
487
487
|
Marks up the current link to be followed *as fast as possible*.
|
488
488
|
|
489
489
|
This is done by:
|
@@ -518,7 +518,7 @@ up.link = (($) ->
|
|
518
518
|
newAttrs['up-target'] = target
|
519
519
|
u.setMissingAttrs($element, newAttrs)
|
520
520
|
|
521
|
-
|
521
|
+
###**
|
522
522
|
Add an `[up-expand]` attribute to any element that contains a link
|
523
523
|
in order to enlarge the link's click area.
|
524
524
|
|
@@ -581,7 +581,7 @@ up.link = (($) ->
|
|
581
581
|
$area.removeAttr('up-expand')
|
582
582
|
makeFollowable($area)
|
583
583
|
|
584
|
-
knife: eval(Knife
|
584
|
+
<% if ENV['JS_KNIFE'] %>knife: eval(Knife.point)<% end %>
|
585
585
|
visit: visit
|
586
586
|
follow: follow
|
587
587
|
makeFollowable: makeFollowable
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
###**
|
2
2
|
Logging
|
3
3
|
=======
|
4
4
|
|
@@ -20,7 +20,7 @@ up.log = (($) ->
|
|
20
20
|
|
21
21
|
SESSION_KEY_ENABLED = 'up.log.enabled'
|
22
22
|
|
23
|
-
|
23
|
+
###**
|
24
24
|
Configures the logging output on the developer console.
|
25
25
|
|
26
26
|
@property up.log.config
|
@@ -50,7 +50,7 @@ up.log = (($) ->
|
|
50
50
|
prefix = (message) ->
|
51
51
|
"#{config.prefix}#{message}"
|
52
52
|
|
53
|
-
|
53
|
+
###**
|
54
54
|
Prints a debugging message to the browser console.
|
55
55
|
|
56
56
|
@function up.log.debug
|
@@ -62,7 +62,7 @@ up.log = (($) ->
|
|
62
62
|
if config.enabled && message
|
63
63
|
b.puts('debug', prefix(message), args...)
|
64
64
|
|
65
|
-
|
65
|
+
###**
|
66
66
|
Prints a logging message to the browser console.
|
67
67
|
|
68
68
|
@function up.puts
|
@@ -74,7 +74,7 @@ up.log = (($) ->
|
|
74
74
|
if config.enabled && message
|
75
75
|
b.puts('log', prefix(message), args...)
|
76
76
|
|
77
|
-
|
77
|
+
###**
|
78
78
|
@function up.log.warn
|
79
79
|
@internal
|
80
80
|
###
|
@@ -82,7 +82,7 @@ up.log = (($) ->
|
|
82
82
|
if message
|
83
83
|
b.puts('warn', prefix(message), args...)
|
84
84
|
|
85
|
-
|
85
|
+
###**
|
86
86
|
- Makes sure the group always closes
|
87
87
|
- Does not make a group if the message is nil
|
88
88
|
|
@@ -101,7 +101,7 @@ up.log = (($) ->
|
|
101
101
|
else
|
102
102
|
block()
|
103
103
|
|
104
|
-
|
104
|
+
###**
|
105
105
|
@function up.log.error
|
106
106
|
@internal
|
107
107
|
###
|
@@ -130,7 +130,7 @@ up.log = (($) ->
|
|
130
130
|
b.sessionStorage().setItem(SESSION_KEY_ENABLED, value.toString())
|
131
131
|
config.enabled = value
|
132
132
|
|
133
|
-
|
133
|
+
###**
|
134
134
|
Makes future Unpoly events print vast amounts of debugging information to the developer console.
|
135
135
|
|
136
136
|
Debugging information includes which elements are being [compiled](/up.syntax)
|
@@ -142,7 +142,7 @@ up.log = (($) ->
|
|
142
142
|
enable = ->
|
143
143
|
setEnabled(true)
|
144
144
|
|
145
|
-
|
145
|
+
###**
|
146
146
|
Prevents future Unpoly events from printing vast amounts of debugging information to the developer console.
|
147
147
|
|
148
148
|
Errors will still be printed, even with logging disabled.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
###**
|
2
2
|
Modal dialogs
|
3
3
|
=============
|
4
4
|
|
@@ -60,7 +60,7 @@ up.modal = (($) ->
|
|
60
60
|
|
61
61
|
u = up.util
|
62
62
|
|
63
|
-
|
63
|
+
###**
|
64
64
|
Sets default options for future modals.
|
65
65
|
|
66
66
|
@property up.modal.config
|
@@ -151,7 +151,7 @@ up.modal = (($) ->
|
|
151
151
|
</div>
|
152
152
|
"""
|
153
153
|
|
154
|
-
|
154
|
+
###**
|
155
155
|
Define modal variants with their own default configuration, CSS or HTML template.
|
156
156
|
|
157
157
|
\#\#\# Example
|
@@ -192,7 +192,7 @@ up.modal = (($) ->
|
|
192
192
|
flavors = u.openConfig
|
193
193
|
default: {}
|
194
194
|
|
195
|
-
|
195
|
+
###**
|
196
196
|
Returns the source URL for the fragment displayed in the current modal overlay,
|
197
197
|
or `undefined` if no modal is currently open.
|
198
198
|
|
@@ -202,7 +202,7 @@ up.modal = (($) ->
|
|
202
202
|
@stable
|
203
203
|
###
|
204
204
|
|
205
|
-
|
205
|
+
###**
|
206
206
|
Returns the URL of the page behind the modal overlay.
|
207
207
|
|
208
208
|
@function up.modal.coveredUrl
|
@@ -291,7 +291,7 @@ up.modal = (($) ->
|
|
291
291
|
unshiftElements = ->
|
292
292
|
unshifter() while unshifter = state.unshifters.pop()
|
293
293
|
|
294
|
-
|
294
|
+
###**
|
295
295
|
Returns whether a modal is currently open.
|
296
296
|
|
297
297
|
This also returns `true` if the modal is in an opening or closing animation.
|
@@ -303,7 +303,7 @@ up.modal = (($) ->
|
|
303
303
|
isOpen = ->
|
304
304
|
state.phase == 'opened' || state.phase == 'opening'
|
305
305
|
|
306
|
-
|
306
|
+
###**
|
307
307
|
Opens the given link's destination in a modal overlay:
|
308
308
|
|
309
309
|
var $link = $('...');
|
@@ -366,7 +366,7 @@ up.modal = (($) ->
|
|
366
366
|
# and (2) our pending AJAX request does not prevent other modals from opening
|
367
367
|
openNow(options)
|
368
368
|
|
369
|
-
|
369
|
+
###**
|
370
370
|
Opens a modal for the given URL.
|
371
371
|
|
372
372
|
\#\#\# Example
|
@@ -396,7 +396,7 @@ up.modal = (($) ->
|
|
396
396
|
options.url = url
|
397
397
|
openAsap(options)
|
398
398
|
|
399
|
-
|
399
|
+
###**
|
400
400
|
[Extracts](/up.extract) the given CSS selector from the given HTML string and
|
401
401
|
opens the results in a modal.
|
402
402
|
|
@@ -495,7 +495,7 @@ up.modal = (($) ->
|
|
495
495
|
up.emit('up:modal:opened', message: 'Modal opened')
|
496
496
|
promise
|
497
497
|
|
498
|
-
|
498
|
+
###**
|
499
499
|
This event is [emitted](/up.emit) when a modal dialog is starting to open.
|
500
500
|
|
501
501
|
@event up:modal:open
|
@@ -504,14 +504,14 @@ up.modal = (($) ->
|
|
504
504
|
@stable
|
505
505
|
###
|
506
506
|
|
507
|
-
|
507
|
+
###**
|
508
508
|
This event is [emitted](/up.emit) when a modal dialog has finished opening.
|
509
509
|
|
510
510
|
@event up:modal:opened
|
511
511
|
@stable
|
512
512
|
###
|
513
513
|
|
514
|
-
|
514
|
+
###**
|
515
515
|
Closes a currently opened modal overlay.
|
516
516
|
|
517
517
|
Does nothing if no modal is currently open.
|
@@ -589,7 +589,7 @@ up.modal = (($) ->
|
|
589
589
|
promise = promise.then -> markAsAnimating(false)
|
590
590
|
promise
|
591
591
|
|
592
|
-
|
592
|
+
###**
|
593
593
|
This event is [emitted](/up.emit) when a modal dialog
|
594
594
|
is starting to [close](/up.modal.close).
|
595
595
|
|
@@ -599,7 +599,7 @@ up.modal = (($) ->
|
|
599
599
|
@stable
|
600
600
|
###
|
601
601
|
|
602
|
-
|
602
|
+
###**
|
603
603
|
This event is [emitted](/up.emit) when a modal dialog
|
604
604
|
is done [closing](/up.modal.close).
|
605
605
|
|
@@ -612,7 +612,7 @@ up.modal = (($) ->
|
|
612
612
|
discardHistory()
|
613
613
|
closeAsap()
|
614
614
|
|
615
|
-
|
615
|
+
###**
|
616
616
|
Returns whether the given element or selector is contained
|
617
617
|
within the current modal.
|
618
618
|
|
@@ -630,7 +630,7 @@ up.modal = (($) ->
|
|
630
630
|
up.log.warn 'up.modal.flavor() is deprecated. Use the up.modal.flavors property instead.'
|
631
631
|
u.assign(flavorOverrides(name), overrideConfig)
|
632
632
|
|
633
|
-
|
633
|
+
###**
|
634
634
|
Returns a config object for the given flavor.
|
635
635
|
Properties in that config should be preferred to the defaults in
|
636
636
|
[`/up.modal.config`](/up.modal.config).
|
@@ -641,7 +641,7 @@ up.modal = (($) ->
|
|
641
641
|
flavorOverrides = (flavor) ->
|
642
642
|
flavors[flavor] ||= {}
|
643
643
|
|
644
|
-
|
644
|
+
###**
|
645
645
|
Returns the config option for the current flavor.
|
646
646
|
|
647
647
|
@function flavorDefault
|
@@ -652,7 +652,7 @@ up.modal = (($) ->
|
|
652
652
|
value = config[key] if u.isMissing(value)
|
653
653
|
value
|
654
654
|
|
655
|
-
|
655
|
+
###**
|
656
656
|
Clicking this link will load the destination via AJAX and open
|
657
657
|
the given selector in a modal dialog.
|
658
658
|
|
@@ -733,7 +733,7 @@ up.modal = (($) ->
|
|
733
733
|
up.bus.onEscape ->
|
734
734
|
closeAsap() if state.closable
|
735
735
|
|
736
|
-
|
736
|
+
###**
|
737
737
|
When this element is clicked, closes a currently open dialog.
|
738
738
|
|
739
739
|
Does nothing if no modal is currently open.
|
@@ -755,7 +755,7 @@ up.modal = (($) ->
|
|
755
755
|
up.bus.consumeAction(event)
|
756
756
|
)
|
757
757
|
|
758
|
-
|
758
|
+
###**
|
759
759
|
Clicking this link will load the destination via AJAX and open
|
760
760
|
the given selector in a modal drawer that slides in from the edge of the screen.
|
761
761
|
|
@@ -787,7 +787,7 @@ up.modal = (($) ->
|
|
787
787
|
'up-modal': target
|
788
788
|
'up-flavor': 'drawer'
|
789
789
|
|
790
|
-
|
790
|
+
###**
|
791
791
|
Sets default options for future drawers.
|
792
792
|
|
793
793
|
@property up.modal.flavors.drawer
|
@@ -821,7 +821,7 @@ up.modal = (($) ->
|
|
821
821
|
# The framework is reset between tests
|
822
822
|
up.on 'up:framework:reset', reset
|
823
823
|
|
824
|
-
knife: eval(Knife
|
824
|
+
<% if ENV['JS_KNIFE'] %>knife: eval(Knife.point)<% end %>
|
825
825
|
visit: visitAsap
|
826
826
|
follow: followAsap
|
827
827
|
extract: extractAsap
|