summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormdeweerd <m.deweerd@ieee.org>2016-03-13 23:27:39 +0100
committermdeweerd <m.deweerd@ieee.org>2016-03-13 23:27:39 +0100
commitffc13ff71d5d0ceea4e6eed0b5d2f81c6f9382c3 (patch)
tree5daee454ed71cab76f8d7a29093ad2798cf1357e
parent05449b33168f855c53bbe3cb952d0ab950395734 (diff)
downloadmulti-select-ffc13ff71d5d0ceea4e6eed0b5d2f81c6f9382c3.zip
multi-select-ffc13ff71d5d0ceea4e6eed0b5d2f81c6f9382c3.tar.gz
multi-select-ffc13ff71d5d0ceea4e6eed0b5d2f81c6f9382c3.tar.bz2
Update jquery.multi-select.js
Missing ";" resulting in a failing script after packing. To discover these locations 'JSHint' was used. JSHint also complained about 'undefined' comparisons that should use '===' so these were fixed as well.
-rw-r--r--js/jquery.multi-select.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/js/jquery.multi-select.js b/js/jquery.multi-select.js
index 5c25713..fb478f5 100644
--- a/js/jquery.multi-select.js
+++ b/js/jquery.multi-select.js
@@ -84,7 +84,7 @@
ms.on('focus', function(){
that.$selectableUl.focus();
- })
+ });
}
var selectedValues = ms.find('option:selected').map(function(){ return $(this).val(); }).get();
@@ -149,22 +149,22 @@
$selectionOptgroup.append($(optgroupTpl));
if (that.options.selectableOptgroup){
$selectableOptgroup.find('.ms-optgroup-label').on('click', function(){
- var values = $optgroup.children(':not(:selected, :disabled)').map(function(){ return $(this).val() }).get();
+ var values = $optgroup.children(':not(:selected, :disabled)').map(function(){ return $(this).val();}).get();
that.select(values);
});
$selectionOptgroup.find('.ms-optgroup-label').on('click', function(){
- var values = $optgroup.children(':selected:not(:disabled)').map(function(){ return $(this).val() }).get();
+ var values = $optgroup.children(':selected:not(:disabled)').map(function(){ return $(this).val();}).get();
that.deselect(values);
});
}
that.$selectableUl.append($selectableOptgroup);
that.$selectionUl.append($selectionOptgroup);
}
- index = index == undefined ? $selectableOptgroup.find('ul').children().length : index + 1;
+ index = index === undefined ? $selectableOptgroup.find('ul').children().length : index + 1;
selectableLi.insertAt(index, $selectableOptgroup.children());
selectedLi.insertAt(index, $selectionOptgroup.children());
} else {
- index = index == undefined ? that.$selectableUl.children().length : index;
+ index = index === undefined ? that.$selectableUl.children().length : index;
selectableLi.insertAt(index, that.$selectableUl);
selectedLi.insertAt(index, that.$selectionUl);
@@ -182,12 +182,12 @@
that.$element.find("option[value='"+option.value+"']").length === 0){
var $option = $('<option value="'+option.value+'">'+option.text+'</option>'),
index = parseInt((typeof option.index === 'undefined' ? that.$element.children().length : option.index)),
- $container = option.nested == undefined ? that.$element : $("optgroup[label='"+option.nested+"']")
+ $container = option.nested === undefined ? that.$element : $("optgroup[label='"+option.nested+"']");
$option.insertAt(index, $container);
that.generateLisFromOption($option.get(0), index, option.nested);
}
- })
+ });
},
'escapeHTML' : function(text){
@@ -329,7 +329,7 @@
});
this.$container.on('mouseleave', that.elemsSelector, function () {
- $(this).parents('.ms-container').find(that.elemsSelector).removeClass('ms-hover');;
+ $(this).parents('.ms-container').find(that.elemsSelector).removeClass('ms-hover');
});
},
@@ -341,7 +341,7 @@
'destroy' : function(){
$("#ms-"+this.$element.attr("id")).remove();
this.$element.off('focus');
- this.$element.css('position', '').css('left', '')
+ this.$element.css('position', '').css('left', '');
this.$element.removeData('multiselect');
},
@@ -531,6 +531,6 @@
$parent.children().eq(index - 1).after(this);
}
});
-}
+};
}(window.jQuery);