From a6c5302e719cc159d39ac3a8b778d2b4ed9dce76 Mon Sep 17 00:00:00 2001 From: UltCombo Date: Mon, 15 Jul 2013 11:59:34 -0300 Subject: [PATCH] fixes #1536 --- select2.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/select2.js b/select2.js index a4620dfd..23ea2156 100644 --- a/select2.js +++ b/select2.js @@ -1087,12 +1087,16 @@ the specific language governing permissions and limitations under the Apache Lic // abstract enable: function(enabled) { if (enabled === undefined) enabled = true; - if (this._enabled === enabled) return false; + if (this._enabled === enabled) return; this._enabled = enabled; this.opts.element.prop("disabled", !enabled); this.enableInterface(); - return true; + }, + + // abstract + disable: function() { + this.enable(false); }, // abstract @@ -3041,7 +3045,7 @@ the specific language governing permissions and limitations under the Apache Lic opts, select2, method, value, multiple, - allowedMethods = ["val", "destroy", "opened", "open", "close", "focus", "isFocused", "container", "dropdown", "onSortStart", "onSortEnd", "enable", "readonly", "positionDropdown", "data", "search"], + allowedMethods = ["val", "destroy", "opened", "open", "close", "focus", "isFocused", "container", "dropdown", "onSortStart", "onSortEnd", "enable", "disable", "readonly", "positionDropdown", "data", "search"], valueMethods = ["opened", "isFocused", "container", "dropdown"], propertyMethods = ["val", "data"], methodsMap = { search: "externalSearch" };