|
@ -67,7 +67,6 @@ $.fn.dropdown = function(parameters) { |
|
|
if(hasTouch) { |
|
|
if(hasTouch) { |
|
|
module.bind.touchEvents(); |
|
|
module.bind.touchEvents(); |
|
|
} |
|
|
} |
|
|
// no use detecting mouse events because touch devices emulate them
|
|
|
|
|
|
module.bind.mouseEvents(); |
|
|
module.bind.mouseEvents(); |
|
|
module.instantiate(); |
|
|
module.instantiate(); |
|
|
}, |
|
|
}, |
|
@ -146,6 +145,7 @@ $.fn.dropdown = function(parameters) { |
|
|
if(hasTouch) { |
|
|
if(hasTouch) { |
|
|
$document |
|
|
$document |
|
|
.off('touchstart' + eventNamespace) |
|
|
.off('touchstart' + eventNamespace) |
|
|
|
|
|
.off('touchmove' + eventNamespace) |
|
|
; |
|
|
; |
|
|
} |
|
|
} |
|
|
$document |
|
|
$document |
|
@ -216,11 +216,19 @@ $.fn.dropdown = function(parameters) { |
|
|
: $choice.text(), |
|
|
: $choice.text(), |
|
|
value = ( $choice.data(metadata.value) !== undefined) |
|
|
value = ( $choice.data(metadata.value) !== undefined) |
|
|
? $choice.data(metadata.value) |
|
|
? $choice.data(metadata.value) |
|
|
: text.toLowerCase() |
|
|
|
|
|
|
|
|
: text.toLowerCase(), |
|
|
|
|
|
callback = function() { |
|
|
|
|
|
module.determine.selectAction(text, value); |
|
|
|
|
|
$.proxy(settings.onChange, element)(value, text); |
|
|
|
|
|
} |
|
|
; |
|
|
; |
|
|
if( $choice.find(selector.menu).size() === 0 ) { |
|
|
if( $choice.find(selector.menu).size() === 0 ) { |
|
|
module.determine.selectAction(text, value); |
|
|
|
|
|
$.proxy(settings.onChange, element)(value, text); |
|
|
|
|
|
|
|
|
if(event.type == 'touchstart') { |
|
|
|
|
|
$choice.one('click', callback); |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
callback(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -546,12 +554,14 @@ $.fn.dropdown = function(parameters) { |
|
|
if(module.is.visible($currentMenu) ) { |
|
|
if(module.is.visible($currentMenu) ) { |
|
|
module.verbose('Doing menu hide animation', $currentMenu); |
|
|
module.verbose('Doing menu hide animation', $currentMenu); |
|
|
if($.fn.transition !== undefined && $module.transition('is supported')) { |
|
|
if($.fn.transition !== undefined && $module.transition('is supported')) { |
|
|
$currentMenu.transition({ |
|
|
|
|
|
animation : settings.transition + ' out', |
|
|
|
|
|
duration : settings.duration, |
|
|
|
|
|
complete : callback, |
|
|
|
|
|
queue : false |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
$currentMenu |
|
|
|
|
|
.transition({ |
|
|
|
|
|
animation : settings.transition + ' out', |
|
|
|
|
|
duration : settings.duration, |
|
|
|
|
|
complete : callback, |
|
|
|
|
|
queue : false |
|
|
|
|
|
}) |
|
|
|
|
|
; |
|
|
} |
|
|
} |
|
|
else if(settings.transition == 'none') { |
|
|
else if(settings.transition == 'none') { |
|
|
callback(); |
|
|
callback(); |
|
|