Skip to content

Commit a6c5302

Browse files
author
UltCombo
committed
fixes select2#1536
1 parent 0687909 commit a6c5302

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

select2.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,12 +1087,16 @@ the specific language governing permissions and limitations under the Apache Lic
10871087
// abstract
10881088
enable: function(enabled) {
10891089
if (enabled === undefined) enabled = true;
1090-
if (this._enabled === enabled) return false;
1090+
if (this._enabled === enabled) return;
10911091
this._enabled = enabled;
10921092

10931093
this.opts.element.prop("disabled", !enabled);
10941094
this.enableInterface();
1095-
return true;
1095+
},
1096+
1097+
// abstract
1098+
disable: function() {
1099+
this.enable(false);
10961100
},
10971101

10981102
// abstract
@@ -3041,7 +3045,7 @@ the specific language governing permissions and limitations under the Apache Lic
30413045
opts,
30423046
select2,
30433047
method, value, multiple,
3044-
allowedMethods = ["val", "destroy", "opened", "open", "close", "focus", "isFocused", "container", "dropdown", "onSortStart", "onSortEnd", "enable", "readonly", "positionDropdown", "data", "search"],
3048+
allowedMethods = ["val", "destroy", "opened", "open", "close", "focus", "isFocused", "container", "dropdown", "onSortStart", "onSortEnd", "enable", "disable", "readonly", "positionDropdown", "data", "search"],
30453049
valueMethods = ["opened", "isFocused", "container", "dropdown"],
30463050
propertyMethods = ["val", "data"],
30473051
methodsMap = { search: "externalSearch" };

0 commit comments

Comments
 (0)