From ccffc70713c8c2630527f82c0872b2e13160ca51 Mon Sep 17 00:00:00 2001 From: Dennis Thompson Date: Sun, 5 Feb 2017 21:00:21 -0800 Subject: [PATCH] Removing focus after deselect_all and select_all --- js/jquery.multi-select.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/jquery.multi-select.js b/js/jquery.multi-select.js index d71ca10..d5483f8 100644 --- a/js/jquery.multi-select.js +++ b/js/jquery.multi-select.js @@ -176,7 +176,7 @@ if (options.value !== undefined && options.value !== null){ options = [options]; - } + } $.each(options, function(index, option){ if (option.value !== undefined && option.value !== null && that.$element.find("option[value='"+option.value+"']").length === 0){ @@ -297,7 +297,7 @@ } if ($nextElem.length > 0){ $nextElem.addClass('ms-hover'); - var scrollTo = $list.scrollTop() + $nextElem.position().top - + var scrollTo = $list.scrollTop() + $nextElem.position().top - containerHeight / 2 + elemHeight / 2; $list.scrollTop(scrollTo); @@ -459,7 +459,7 @@ this.$selectionUl.find('.ms-optgroup-label').show(); this.$selectableUl.find('.ms-optgroup-label').hide(); this.$selectionUl.find('.ms-elem-selection').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').show(); - this.$selectionUl.focus(); + // this.$selectionUl.focus(); ms.trigger('change'); if (typeof this.options.afterSelect === 'function') { var selectedValues = $.grep(ms.val(), function(item){ @@ -478,7 +478,7 @@ this.$selectionUl.find('.ms-optgroup-label').hide(); this.$selectableUl.find('.ms-optgroup-label').show(); this.$selectionUl.find('.ms-elem-selection').removeClass('ms-selected').hide(); - this.$selectableUl.focus(); + // this.$selectableUl.focus(); ms.trigger('change'); if (typeof this.options.afterDeselect === 'function') { this.options.afterDeselect.call(this, values);