From 97c2a7e4f8874da93a46f513b42b6818e6c9bdfa Mon Sep 17 00:00:00 2001 From: Jack Lukic Date: Sun, 6 Aug 2017 22:09:02 -0700 Subject: [PATCH] Updated distribution to version 2.2.12 --- definitions/collections/menu.less | 1 - definitions/modules/dropdown.js | 59 ++++++++++++++++++++---- definitions/modules/dropdown.less | 4 +- definitions/modules/modal.js | 29 ++++++++++-- definitions/modules/modal.less | 6 +++ definitions/modules/popup.js | 4 +- package.js | 2 +- package.json | 2 +- themes/bookish/elements/header.overrides | 2 +- themes/chubby/elements/button.overrides | 2 +- themes/chubby/elements/header.overrides | 2 +- themes/default/elements/header.variables | 2 +- themes/default/elements/list.variables | 2 +- themes/default/modules/modal.variables | 6 +++ themes/instagram/views/card.overrides | 2 +- themes/rtl/globals/site.overrides | 2 +- 16 files changed, 99 insertions(+), 28 deletions(-) diff --git a/definitions/collections/menu.less b/definitions/collections/menu.less index 84f9127..defaad5 100644 --- a/definitions/collections/menu.less +++ b/definitions/collections/menu.less @@ -211,7 +211,6 @@ /* Menu */ .ui.menu .dropdown.item .menu { - left: 0px; min-width: ~"calc(100% - 1px)"; border-radius: 0em 0em @dropdownMenuBorderRadius @dropdownMenuBorderRadius; background: @dropdownBackground; diff --git a/definitions/modules/dropdown.js b/definitions/modules/dropdown.js index 25ee5f3..805d06f 100644 --- a/definitions/modules/dropdown.js +++ b/definitions/modules/dropdown.js @@ -97,7 +97,13 @@ $.fn.dropdown = function(parameters) { module.setup.reference(); } else { + module.setup.layout(); + + if(settings.values) { + module.change.values(settings.values); + } + module.refreshData(); module.save.defaults(); @@ -162,7 +168,7 @@ $.fn.dropdown = function(parameters) { observe: { select: function() { if(module.has.input()) { - selectObserver.observe($input[0], { + selectObserver.observe($module[0], { childList : true, subtree : true }); @@ -383,19 +389,16 @@ $.fn.dropdown = function(parameters) { reference: function() { module.debug('Dropdown behavior was called on select, replacing with closest dropdown'); // replace module reference - $module = $module.parent(selector.dropdown); + $module = $module.parent(selector.dropdown); + instance = $module.data(moduleNamespace); + element = $module.get(0); module.refresh(); module.setup.returnedObject(); - // invoke method in context of current instance - if(methodInvoked) { - instance = module; - module.invoke(query); - } }, returnedObject: function() { var $firstModules = $allModules.slice(0, elementIndex), - $lastModules = $allModules.slice(elementIndex + 1) + $lastModules = $allModules.slice(elementIndex + 1) ; // adjust all modules to use correct reference $allModules = $firstModules.add($module).add($lastModules); @@ -913,6 +916,23 @@ $.fn.dropdown = function(parameters) { } }, + change: { + values: function(values) { + if(!settings.allowAdditions) { + module.clear(); + } + module.debug('Creating dropdown with specified values', values); + module.setup.menu({values: values}); + $.each(values, function(index, item) { + if(item.selected == true) { + module.debug('Setting initial selection to', item.value); + module.set.selected(item.value); + return true; + } + }); + } + }, + event: { change: function() { if(!internalChange) { @@ -1081,7 +1101,22 @@ $.fn.dropdown = function(parameters) { select: { mutation: function(mutations) { module.debug('