From 94fb519beaefa1fd7a55e666da9854b2fa80faea Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 14 Mar 2014 11:28:04 -0400 Subject: [PATCH] Fixes #694 A dropdown with numeric content for data-text causes an error on toLowerCase --- src/modules/dropdown.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/dropdown.js b/src/modules/dropdown.js index 92ab688ca..aef85a1e1 100755 --- a/src/modules/dropdown.js +++ b/src/modules/dropdown.js @@ -216,7 +216,9 @@ $.fn.dropdown = function(parameters) { : $choice.text(), value = ( $choice.data(metadata.value) !== undefined) ? $choice.data(metadata.value) - : text.toLowerCase(), + : (typeof text === 'string') + ? text.toLowerCase() + : text, callback = function() { module.determine.selectAction(text, value); $.proxy(settings.onChange, element)(value, text); @@ -352,7 +354,9 @@ $.fn.dropdown = function(parameters) { : $choice.text(), optionValue = ( $choice.data(metadata.value) !== undefined ) ? $choice.data(metadata.value) - : optionText.toLowerCase() + : (typeof optionText === 'string') + ? optionText.toLowerCase() + : optionText ; if( optionValue == value ) { $selectedItem = $(this);