diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index 06259b5b9..bf41a7c32 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -73,7 +73,14 @@ $.fn.dropdown = function(parameters) { initialize: function() { module.debug('Initializing dropdown', settings); - module.setup.layout(); + + if( module.is.alreadySetup() ) { + module.error(error.alreadySetup); + } + else { + module.setup.layout(); + } + module.save.defaults(); module.set.selected(); @@ -104,6 +111,9 @@ $.fn.dropdown = function(parameters) { .off(eventNamespace) .removeData(moduleNamespace) ; + $menu + .off(eventNamespace) + ; $document .off(elementNamespace) ; @@ -112,8 +122,14 @@ $.fn.dropdown = function(parameters) { observeChanges: function() { if('MutationObserver' in window) { observer = new MutationObserver(function(mutations) { - module.debug('DOM tree modified, updating selector cache'); - module.refresh(); + if( module.is.selectMutation(mutations) ) { + module.debug('