lib/assets/javascripts/unpoly/popup.js.coffee in unpoly-rails-0.31.2 vs lib/assets/javascripts/unpoly/popup.js.coffee in unpoly-rails-0.32.0

- old
+ new

@@ -5,11 +5,11 @@ Instead of [linking to a page fragment](/up.link), you can choose to show a fragment in a popup overlay that rolls down from an anchoring element. To open a popup, add an [`up-popup` attribute](/up-popup) to a link: - <a href="/options" up-modal=".menu">Show options</a> + <a href="/options" up-popup=".menu">Show options</a> When this link is clicked, Unpoly will request the path `/options` and extract an element matching the selector `.menu` from the response. The matching element will then be placed in the popup overlay. @@ -432,19 +432,18 @@ 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] + @selector .up-popup [up-close] @stable ### - up.on 'click', '[up-close]', (event, $element) -> - if contains($element) - closeAsap() - # Only prevent the default when we actually closed a popup. - # This way we can have buttons that close a popup when within a popup, - # but link to a destination if not. - up.bus.consumeAction(event) + up.on 'click', '.up-popup [up-close]', (event, $element) -> + closeAsap() + # Only prevent the default when we actually closed a popup. + # This way we can have buttons that close a popup when within a popup, + # but link to a destination if not. + up.bus.consumeAction(event) # The framework is reset between tests up.on 'up:framework:reset', reset knife: eval(Knife?.point)