From c17e254c966beaf445825fc29fa459d37755fab6 Mon Sep 17 00:00:00 2001 From: Jack Lukic Date: Mon, 29 Jun 2015 23:17:21 -0400 Subject: [PATCH] #2479 Adds debug data for saving defaults --- src/definitions/modules/dropdown.js | 30 ++++++++++++++++++++------- src/definitions/modules/dropdown.less | 1 - 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index f6807919a9..367bd1ef4f 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -1723,7 +1723,7 @@ $.fn.dropdown = function(parameters) { } }, values: function() { - // prevents callbacks from occuring if specified for initial load + // prevents callbacks from occuring on initial load module.set.initialLoad(); if(settings.apiSettings) { if(settings.saveRemoteData) { @@ -1782,14 +1782,27 @@ $.fn.dropdown = function(parameters) { module.save.defaultValue(); }, defaultValue: function() { - $module.data(metadata.defaultValue, module.get.value()); + var + value = module.get.value() + ; + module.verbose('Saving default value as', value); + $module.data(metadata.defaultValue, value); }, defaultText: function() { - $module.data(metadata.defaultText, $text.text() ); + var + text = module.get.text() + ; + module.verbose('Saving default text as', text); + $module.data(metadata.defaultText, text); }, placeholderText: function() { + var + text + ; if($text.hasClass(className.placeholder)) { - $module.data(metadata.placeholderText, $text.text()); + text = module.get.text(); + module.verbose('Saving placeholder text as', text); + $module.data(metadata.placeholderText, text); } }, remoteData: function(name, value) { @@ -1797,6 +1810,7 @@ $.fn.dropdown = function(parameters) { module.error(error.noStorage); return; } + module.verbose('Saving remote data to session storage', value, name); sessionStorage.setItem(value, name); } }, @@ -1892,10 +1906,12 @@ $.fn.dropdown = function(parameters) { $module.addClass(className.loading); }, placeholderText: function(text) { - module.debug('Restoring placeholder text'); text = text || $module.data(metadata.placeholderText); - module.set.text(text); - $text.addClass(className.placeholder); + if(text) { + module.debug('Restoring placeholder text'); + module.set.text(text); + $text.addClass(className.placeholder); + } }, tabbable: function() { if( module.has.search() ) { diff --git a/src/definitions/modules/dropdown.less b/src/definitions/modules/dropdown.less index 9d07decacd..e1e2abcab9 100755 --- a/src/definitions/modules/dropdown.less +++ b/src/definitions/modules/dropdown.less @@ -535,7 +535,6 @@ select.ui.dropdown { background: none transparent !important; border: none !important; box-shadow: none !important; - border-radius: 0em !important; cursor: pointer; top: 0em; left: 0em;