Skip to content

Commit

Permalink
Fixes #2715 Fixes touchstart event, removes delay from touchstart, fi…
Browse files Browse the repository at this point in the history
…xes possibility of onShow occuring twice when touch events used. Fixes onHide not calling
  • Loading branch information
jlukic committed Jul 23, 2015
1 parent 25b5e71 commit c9d0625
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 8 additions & 7 deletions src/definitions/modules/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $.fn.popup = function(parameters) {

moduleSelector = $allModules.selector || '',

hasTouch = ('ontouchstart' in document.documentElement),
hasTouch = (true),
time = new Date().getTime(),
performance = [],

Expand Down Expand Up @@ -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
Expand All @@ -169,7 +171,7 @@ $.fn.popup = function(parameters) {
},
touchstart: function(event) {
openedWithTouch = true;
module.event.start();
module.show();
},
resize: function() {
if( module.is.visible() ) {
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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')) {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c9d0625

Please sign in to comment.