Browse Source

Fixes #1895 issue with popup not reopening on mobile

pull/1785/merge
jlukic 9 years ago
parent
commit
c191fa1806
2 changed files with 14 additions and 5 deletions
  1. 1
      RELEASE-NOTES.md
  2. 18
      src/definitions/modules/popup.js

1
RELEASE-NOTES.md

@ -14,6 +14,7 @@
**Bugs**
- **Dropdown** - Fixes issue where dropdown would not open after restoring previus value on failed `search dropdown` search
- **Popup** - Fix issue with `popup` not re-opening until another element gains focus on a mobile touchscreen
- **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

18
src/definitions/modules/popup.js

@ -426,13 +426,22 @@ $.fn.popup = function(parameters) {
},
startEvent: function() {
if(settings.on == 'hover') {
return 'mouseenter';
return (hasTouch)
? 'touchstart mouseenter'
: 'mouseenter'
;
}
else if(settings.on == 'focus') {
return 'focus';
}
return false;
},
scrollEvent: function() {
return (hasTouch)
? 'touchmove scroll'
: 'scroll'
;
},
endEvent: function() {
if(settings.on == 'hover') {
return 'mouseleave';
@ -791,6 +800,7 @@ $.fn.popup = function(parameters) {
;
}
else if( module.get.startEvent() ) {
console.log(module.get.startEvent());
$module
.on(module.get.startEvent() + eventNamespace, module.event.start)
.on(module.get.endEvent() + eventNamespace, module.event.end)
@ -813,12 +823,10 @@ $.fn.popup = function(parameters) {
close:function() {
if(settings.hideOnScroll === true || settings.hideOnScroll == 'auto' && settings.on != 'click') {
$document
.one('touchmove' + elementNamespace, module.hideGracefully)
.one('scroll' + elementNamespace, module.hideGracefully)
.one(module.get.scrollEvent() + elementNamespace, module.hideGracefully)
;
$context
.one('touchmove' + elementNamespace, module.hideGracefully)
.one('scroll' + elementNamespace, module.hideGracefully)
.one(module.get.scrollEvent() + elementNamespace, module.hideGracefully)
;
}
if(settings.on == 'click' && settings.closable) {

Loading…
Cancel
Save