diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 9b07ff652..0a3370527 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -192,6 +192,7 @@ - **Popup** - Popup will no longer appear incorrectly if the targeted element is not visible on page - **Popup** - Fixed bug which could cause pre-existing inline popup to be removed from DOM after hiding - **Popup** - Fixes popup offstage position calculations with pages including horizontal scrollbars +- **Popup** - Added `addTouchEvents` to specify whether touch events should be added to trigger popup on mobile - **Rating** - Rating now correctly adjusts if `data` attributes change - **Reveal** - Removed `masked` reveal, all reveals are masked by default - **RTL** - Fixed `rtl: 'both'` in `semantic.json` not building both versions of source correctly. diff --git a/src/definitions/modules/popup.js b/src/definitions/modules/popup.js index bcf82eb1e..5024cde80 100644 --- a/src/definitions/modules/popup.js +++ b/src/definitions/modules/popup.js @@ -443,7 +443,7 @@ $.fn.popup = function(parameters) { }, startEvent: function() { if(settings.on == 'hover') { - return (hasTouch) + return (hasTouch && settings.addTouchEvents) ? 'touchstart mouseenter' : 'mouseenter' ; @@ -454,7 +454,7 @@ $.fn.popup = function(parameters) { return false; }, scrollEvent: function() { - return (hasTouch) + return (hasTouch && settings.addTouchEvents) ? 'touchmove scroll' : 'scroll' ; @@ -1137,6 +1137,9 @@ $.fn.popup.settings = { // when to show popup on : 'hover', + // whether to add touchstart events when using hover + addTouchEvents : true, + // default position relative to element position : 'top left', // name of variation to use