Browse Source

Fixes #2715 Fixes touchstart event, removes delay from touchstart, fixes possibility of onShow occuring twice when touch events used. Fixes onHide not calling

pull/2717/head
jlukic 9 years ago
parent
commit
c9d0625d49
2 changed files with 11 additions and 8 deletions
  1. 4
      RELEASE-NOTES.md
  2. 15
      src/definitions/modules/popup.js

4
RELEASE-NOTES.md

@ -6,10 +6,12 @@
- **Build Tools** - Fixed issue where `npm install semantic-ui` would hang after setup in some version of NPM
- **Build Tools** - Fixed `npm install` with CI or tests. Install will not stop to ask questions if project has an existing `semantic.json` file
- **Dropdown** - Fixed border radius on `circular labeled icon button` #2700
- **Dropdown** - Fixed issue where dropdown nested inside `label` would not open. #2711
**Additional Fixes**
- **Checkbox** - Fix checkbox "check" appearing italicized when included inside italicized text
- **Dropdown** - Fixed issue where dropdown nested inside `label` would not open.
- **Popup** - Fixed terribly typo where popup `onShow` was mistakenly being called instead of `onHide` when hiding popup
- **Popup** - Popup on `touchstart` now occurs immediately without waiting for `delay.show`
### Version 2.0.6 - July 22, 2015

15
src/definitions/modules/popup.js

@ -22,7 +22,7 @@ $.fn.popup = function(parameters) {
moduleSelector = $allModules.selector || '',
hasTouch = ('ontouchstart' in document.documentElement),
hasTouch = (true),
time = new Date().getTime(),
performance = [],
@ -156,7 +156,9 @@ $.fn.popup = function(parameters) {
: settings.delay
;
clearTimeout(module.hideTimer);
module.showTimer = setTimeout(module.show, delay);
if(!openedWithTouch) {
module.showTimer = setTimeout(module.show, delay);
}
},
end: function() {
var
@ -169,7 +171,7 @@ $.fn.popup = function(parameters) {
},
touchstart: function(event) {
openedWithTouch = true;
module.event.start();
module.show();
},
resize: function() {
if( module.is.visible() ) {
@ -279,7 +281,6 @@ $.fn.popup = function(parameters) {
show: function(callback) {
callback = callback || function(){};
module.debug('Showing pop-up', settings.transition);
if(module.is.hidden() && !( module.is.active() && module.is.dropdown()) ) {
if( !module.exists() ) {
module.create();
@ -398,8 +399,8 @@ $.fn.popup = function(parameters) {
hide: function(callback) {
callback = $.isFunction(callback) ? callback : function(){};
module.debug('Hiding pop-up');
if(settings.onShow.call($popup, element) === false) {
module.debug('onShow callback returned false, cancelling popup animation');
if(settings.onHide.call($popup, element) === false) {
module.debug('onHide callback returned false, cancelling popup animation');
return;
}
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
@ -884,7 +885,7 @@ $.fn.popup = function(parameters) {
.on('touchstart' + eventNamespace, module.event.touchstart)
;
}
else if( module.get.startEvent() ) {
if( module.get.startEvent() ) {
$module
.on(module.get.startEvent() + eventNamespace, module.event.start)
.on(module.get.endEvent() + eventNamespace, module.event.end)

Loading…
Cancel
Save