From 732e22cf3deb4a8ccb681af8f74994020f67d7a3 Mon Sep 17 00:00:00 2001 From: jlukic Date: Wed, 29 Apr 2015 18:25:03 -0400 Subject: [PATCH] Add values', value, $input); + if(settings.allowAdditions) { + module.add.optionValue(value); + } } else { value = value.join(settings.delimiter); @@ -1672,7 +1675,6 @@ $.fn.dropdown = function(parameters) { .trigger('change') ; settings.onChange.call(element, value, text, $selected); - } else { module.verbose('Storing value in metadata', value, $input); @@ -1807,6 +1809,34 @@ $.fn.dropdown = function(parameters) { ; } }, + optionValue: function(values) { + if(!$input.is('select')) { + return false; + } + if(selectObserver) { + selectObserver.disconnect(); + } + $.each(values, function(index, value) { + var + $option = $input.find('option[value="' + value + '"]'), + hasOption = ($option.length > 0) + ; + if(!hasOption) { + $('