Browse Source

Add allowTouchEvents setting #2322

pull/2330/head
jlukic 9 years ago
parent
commit
472af4d86f
2 changed files with 6 additions and 2 deletions
  1. 1
      RELEASE-NOTES.md
  2. 7
      src/definitions/modules/popup.js

1
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.

7
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

Loading…
Cancel
Save