lib/assets/javascripts/up/popup.js.coffee in upjs-rails-0.14.0 vs lib/assets/javascripts/up/popup.js.coffee in upjs-rails-0.14.1
- old
+ new
@@ -81,10 +81,11 @@
The animation used to close a popup.
@param {String} [config.position='bottom-right']
Defines where the popup is attached to the opening element.
Valid values are `bottom-right`, `bottom-left`, `top-right` and `top-left`.
+ @stable
###
config = u.config
openAnimation: 'fade-in'
closeAnimation: 'fade-out'
position: 'bottom-right'
@@ -290,11 +291,18 @@
# Close the pop-up overlay when the user presses ESC.
up.bus.onEscape(-> close())
###*
When an element with this attribute is clicked,
- a currently open popup is closed.
-
+ a currently open popup is closed.
+
+ Does nothing if no popup is currently open.
+
+ To make a link that closes the current popup, but follows to
+ a fallback destination if no popup is open:
+
+ <a href="/fallback" up-close>Okay</a>
+
@selector [up-close]
@stable
###
up.on('click', '[up-close]', (event, $element) ->
if $element.closest('.up-popup').length