Browse Source

Fixes #1852 Popup hide all does not call onHidden

pull/1785/merge
jlukic 10 years ago
parent
commit
14b58a15b0
2 changed files with 19 additions and 5 deletions
  1. 3
      RELEASE-NOTES.md
  2. 21
      src/definitions/modules/popup.js

3
RELEASE-NOTES.md

@ -9,6 +9,7 @@
- **Form** - `<select>` now receive error formatting on `form error` **Thanks @davialexandre**
- **Transition** - Added more reasonable default durations for each animation
- **Loader** - `inline loader` now has a `centered` variation
- **Popup** - Added `exclusive` parameter to automatically close other popups on open
- **Transition** - Added `toggle` behavior and docs for `show` and `hide`
- **Transition** - transition now has `stop`, `stop all`, and `clear queue` for removing transitions, (undocumented method `stop`, and `start` renamed to `enable` and `disable`)
- **Dimmer** - Add `opacity` setting to override css value. Add to docs several undocumented settings, like `useCSS`, and `variation`.
@ -16,7 +17,9 @@
**Bugs**
- **Dropdown** - Fixes issue where dropdown would not open after restoring previus value on failed `search dropdown` search
- **Icon** - Fix `clockwise rotated icon` causing `clockwise` icon to appear
- **Popup** - Fix issue with `popup` not re-opening until another element gains focus on a mobile touchscreen
- **Popup** - Popup will now fire `onHidden` when an element is hidden by opening a different popup
- **Popup** - Fix popup not namespacing `window` events and unbinding on `destroy` **Thanks @revov**
- **Transition** - Fixes `swing out` animations not working correctly
- **Transition** - Fixed display state other than `block` not determined when using `show` and `hide` without an animation

21
src/definitions/modules/popup.js

@ -199,6 +199,7 @@ $.fn.popup = function(parameters) {
$popup = $('<div/>')
.addClass(className.popup)
.addClass(variation)
.data(metadata.activator, $module)
.html(html)
;
if(variation) {
@ -227,13 +228,14 @@ $.fn.popup = function(parameters) {
else if($target.next(selector.popup).length !== 0) {
module.verbose('Pre-existing popup found');
settings.inline = true;
settings.popup = $target.next(selector.popup);
settings.popup = $target.next(selector.popup).data(metadata.activator, $module);
module.refresh();
if(settings.hoverable) {
module.bind.popup();
}
}
else if(settings.popup) {
settings.popup.data(metadata.activator, $module);
module.verbose('Used popup specified in settings');
module.refresh();
if(settings.hoverable) {
@ -257,7 +259,6 @@ $.fn.popup = function(parameters) {
if( module.is.hidden() ) {
module.debug('Popup is hidden, showing pop-up');
module.unbind.close();
module.hideAll();
module.show();
}
else {
@ -277,6 +278,9 @@ $.fn.popup = function(parameters) {
}
if( $popup && module.set.position() ) {
module.save.conditions();
if(settings.exclusive) {
module.hideAll();
}
module.animate.show(callback);
}
},
@ -294,8 +298,13 @@ $.fn.popup = function(parameters) {
hideAll: function() {
$(selector.popup)
.filter(':visible')
.transition(settings.transition)
.filter('.' + className.visible)
.each(function() {
$(this)
.data(metadata.activator)
.popup('hide')
;
})
;
},
@ -1100,6 +1109,7 @@ $.fn.popup.settings = {
on : 'hover',
closable : true,
hideOnScroll : 'auto',
exclusive : true,
context : 'body',
@ -1109,7 +1119,7 @@ $.fn.popup.settings = {
delay : {
show : 30,
hide : 0
hide : 1000
},
setFluidWidth : true,
@ -1136,6 +1146,7 @@ $.fn.popup.settings = {
},
metadata: {
activator : 'activator',
content : 'content',
html : 'html',
offset : 'offset',

Loading…
Cancel
Save