Skip to content

Commit

Permalink
#2479 Adds debug data for saving defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed Jun 30, 2015
1 parent d480d5e commit c17e254
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
30 changes: 23 additions & 7 deletions src/definitions/modules/dropdown.js
Expand Up @@ -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) {
Expand Down Expand Up @@ -1782,21 +1782,35 @@ $.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) {
if(window.Storage === undefined) {
module.error(error.noStorage);
return;
}
module.verbose('Saving remote data to session storage', value, name);
sessionStorage.setItem(value, name);
}
},
Expand Down Expand Up @@ -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() ) {
Expand Down
1 change: 0 additions & 1 deletion src/definitions/modules/dropdown.less
Expand Up @@ -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;
Expand Down

0 comments on commit c17e254

Please sign in to comment.