Browse Source

Fix bug in mouseclick on menu item

pull/1129/head
jlukic 10 years ago
parent
commit
90d1215f48
2 changed files with 13 additions and 5 deletions
  1. 1
      server/files/javascript/dropdown.js
  2. 17
      src/definitions/modules/dropdown.js

1
server/files/javascript/dropdown.js

@ -30,6 +30,7 @@ semantic.dropdown.ready = function() {
$transition
.dropdown({
onChange: function(value) {
console.log($transition);
$transition.dropdown('setting', 'transition', value);
}
})

17
src/definitions/modules/dropdown.js

@ -264,7 +264,9 @@ $.fn.dropdown = function(parameters) {
$choice = $(this),
text = ( $choice.data(metadata.text) !== undefined )
? $choice.data(metadata.text)
: $choice.text(),
: (settings.preserveHTML)
? $choice.html()
: $choice.text(),
value = ( $choice.data(metadata.value) !== undefined)
? $choice.data(metadata.value)
: (typeof text === 'string')
@ -313,9 +315,9 @@ $.fn.dropdown = function(parameters) {
activated = true;
module.show();
},
blur: function() {
blur: function(event) {
activated = false;
module.hide();
module.determine.eventInModule(event, module.hide);
},
input: function(event) {
var
@ -467,7 +469,9 @@ $.fn.dropdown = function(parameters) {
$choice = $(this),
text = ( $choice.data(metadata.text) !== undefined )
? $choice.data(metadata.text)
: $choice.text(),
: (settings.preserveHTML)
? $choice.html()
: $choice.text(),
value = ( $choice.data(metadata.value) !== undefined)
? $choice.data(metadata.value)
: (typeof text === 'string')
@ -480,6 +484,7 @@ $.fn.dropdown = function(parameters) {
},
openingSubMenu = ($choice.find(selector.menu).size() > 0)
;
console.log(text, value);
if( !openingSubMenu ) {
if(event.type == 'touchstart') {
$choice.one('click', callback);
@ -682,7 +687,9 @@ $.fn.dropdown = function(parameters) {
$choice = $(this),
optionText = ( $choice.data(metadata.text) !== undefined )
? $choice.data(metadata.text)
: $choice.text(),
: (settings.preserveHTML)
? $choice.html()
: $choice.text(),
optionValue = ( $choice.data(metadata.value) !== undefined )
? $choice.data(metadata.value)
: (typeof optionText === 'string')

Loading…
Cancel
Save