Browse Source

Resolved cache problem for data attributes of dropdown options.

pull/2403/head
Andrea Ascari 9 years ago
parent
commit
7325170154
1 changed files with 20 additions and 0 deletions
  1. 20
      src/definitions/modules/dropdown.js

20
src/definitions/modules/dropdown.js

@ -80,6 +80,7 @@ $.fn.dropdown = function(parameters) {
initialize: function() { initialize: function() {
module.debug('Initializing dropdown', settings); module.debug('Initializing dropdown', settings);
if( module.is.alreadySetup() ) { if( module.is.alreadySetup() ) {
module.setup.reference(); module.setup.reference();
} }
@ -98,6 +99,8 @@ $.fn.dropdown = function(parameters) {
module.observeChanges(); module.observeChanges();
module.instantiate(); module.instantiate();
} }
module.refreshData();
}, },
instantiate: function() { instantiate: function() {
@ -352,8 +355,25 @@ $.fn.dropdown = function(parameters) {
; ;
$menu = $module.children(selector.menu); $menu = $module.children(selector.menu);
$item = $menu.find(selector.item); $item = $menu.find(selector.item);
module.refreshData();
},
refreshData: function() {
$menu
.children()
.each(function() {
$(this).removeData(metadata.text);
$(this).removeData(metadata.value);
});
$module.removeData(metadata.defaultText);
$module.removeData(metadata.defaultValue);
$module.removeData(metadata.placeholderText);
}, },
toggle: function() { toggle: function() {
module.verbose('Toggling menu visibility'); module.verbose('Toggling menu visibility');
if( !module.is.active() ) { if( !module.is.active() ) {

Loading…
Cancel
Save