|
@ -210,8 +210,12 @@ $.fn.dropdown = function(parameters) { |
|
|
click: function (event) { |
|
|
click: function (event) { |
|
|
var |
|
|
var |
|
|
$choice = $(this), |
|
|
$choice = $(this), |
|
|
text = $choice.data(metadata.text) || $choice.text(), |
|
|
|
|
|
value = $choice.data(metadata.value) || text.toLowerCase() |
|
|
|
|
|
|
|
|
text = ( $choice.data(metadata.text) !== undefined ) |
|
|
|
|
|
? $choice.data(metadata.text) |
|
|
|
|
|
: $choice.text(), |
|
|
|
|
|
value = ( $choice.data(metadata.value) !== undefined) |
|
|
|
|
|
? $choice.data(metadata.value) |
|
|
|
|
|
: text.toLowerCase() |
|
|
; |
|
|
; |
|
|
if( $choice.find(selector.menu).size() === 0 ) { |
|
|
if( $choice.find(selector.menu).size() === 0 ) { |
|
|
module.determine.selectAction(text, value); |
|
|
module.determine.selectAction(text, value); |
|
@ -322,15 +326,21 @@ $.fn.dropdown = function(parameters) { |
|
|
; |
|
|
; |
|
|
value = (value !== undefined) |
|
|
value = (value !== undefined) |
|
|
? value |
|
|
? value |
|
|
: ( module.get.value() || module.get.text() ) |
|
|
|
|
|
|
|
|
: ( module.get.value() !== undefined) |
|
|
|
|
|
? module.get.value() |
|
|
|
|
|
: module.get.text() |
|
|
; |
|
|
; |
|
|
if(value) { |
|
|
if(value) { |
|
|
$item |
|
|
$item |
|
|
.each(function() { |
|
|
.each(function() { |
|
|
var |
|
|
var |
|
|
$choice = $(this), |
|
|
$choice = $(this), |
|
|
optionText = $choice.data(metadata.text) || $choice.text(), |
|
|
|
|
|
optionValue = $choice.data(metadata.value) || optionText.toLowerCase() |
|
|
|
|
|
|
|
|
optionText = ( $choice.data(metadata.text) !== undefined ) |
|
|
|
|
|
? $choice.data(metadata.text) |
|
|
|
|
|
: $choice.text(), |
|
|
|
|
|
optionValue = ( $choice.data(metadata.value) !== undefined ) |
|
|
|
|
|
? $choice.data(metadata.value) |
|
|
|
|
|
: optionText.toLowerCase() |
|
|
; |
|
|
; |
|
|
if( optionValue == value || optionText == value ) { |
|
|
if( optionValue == value || optionText == value ) { |
|
|
$selectedItem = $(this); |
|
|
$selectedItem = $(this); |
|
@ -369,7 +379,10 @@ $.fn.dropdown = function(parameters) { |
|
|
; |
|
|
; |
|
|
if($selectedItem) { |
|
|
if($selectedItem) { |
|
|
module.debug('Setting selected menu item to', $selectedItem); |
|
|
module.debug('Setting selected menu item to', $selectedItem); |
|
|
selectedText = $selectedItem.data(metadata.text) || $selectedItem.text(); |
|
|
|
|
|
|
|
|
selectedText = ($selectedItem.data(metadata.text) !== undefined) |
|
|
|
|
|
? $selectedItem.data(metadata.text) |
|
|
|
|
|
: $selectedItem.text() |
|
|
|
|
|
; |
|
|
$item |
|
|
$item |
|
|
.removeClass(className.active) |
|
|
.removeClass(className.active) |
|
|
; |
|
|
; |
|
|