Skip to content

Commit

Permalink
#2666 - remove label does not correctly use get.values() internally, …
Browse files Browse the repository at this point in the history
…causing a type error with multiple
  • Loading branch information
jlukic committed Jul 20, 2015
1 parent 54918e9 commit 14dea43
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ $.fn.dropdown = function(parameters) {
.html( templates.dropdown(selectValues) )
.insertBefore($input)
;
if($input.hasClass(className.multiple)) {
if($input.hasClass(className.multiple) && $input.prop('multiple') === false) {
module.error(error.missingMultiple);
$input.prop('multiple', true);
}
if($input.is('[multiple]')) {
Expand Down Expand Up @@ -2352,7 +2353,6 @@ $.fn.dropdown = function(parameters) {
currentValue = module.get.values(),
newValue
;
console.log(currentValue);
if(addedValue === '') {
module.debug('Cannot select blank values from multiselect');
return;
Expand Down Expand Up @@ -2497,7 +2497,7 @@ $.fn.dropdown = function(parameters) {
},
value: function(removedValue, removedText, $removedItem) {
var
values = $input.val(),
values = module.get.values(),
newValue
;
if( module.has.selectInput() ) {
Expand All @@ -2507,9 +2507,9 @@ $.fn.dropdown = function(parameters) {
}
else {
module.verbose('Removing from delimited values', removedValue);
values = values.split(settings.delimiter);
newValue = module.remove.arrayValue(removedValue, values);
newValue = newValue.join(settings.delimiter);
console.log(newValue);
}
if(settings.fireOnInit === false && module.is.initialLoad()) {
module.verbose('No callback on initial load', settings.onRemove);
Expand Down Expand Up @@ -3188,13 +3188,14 @@ $.fn.dropdown.settings = {
},

error : {
action : 'You called a dropdown action that was not defined',
alreadySetup : 'Once a select has been initialized behaviors must be called on the created ui dropdown',
labels : 'Allowing user additions currently requires the use of labels.',
method : 'The method you called is not defined.',
noAPI : 'The API module is required to load resources remotely',
noStorage : 'Saving remote data requires session storage',
noTransition : 'This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>'
action : 'You called a dropdown action that was not defined',
alreadySetup : 'Once a select has been initialized behaviors must be called on the created ui dropdown',
labels : 'Allowing user additions currently requires the use of labels.',
missingMultiple : '<select> requires multiple property to be set to correctly preserve multiple values',
method : 'The method you called is not defined.',
noAPI : 'The API module is required to load resources remotely',
noStorage : 'Saving remote data requires session storage',
noTransition : 'This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>'
},

regExp : {
Expand Down

0 comments on commit 14dea43

Please sign in to comment.