Browse Source

#2479 Adds debug data for saving defaults

pull/2492/head
Jack Lukic 9 years ago
parent
commit
c17e254c96
2 changed files with 23 additions and 8 deletions
  1. 30
      src/definitions/modules/dropdown.js
  2. 1
      src/definitions/modules/dropdown.less

30
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() ) {

1
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;

Loading…
Cancel
Save