1
0
mirror of synced 2024-11-26 06:46:04 +03:00

prevent opening of a disabled select via api. fixes #1272

This commit is contained in:
Igor Vaynberg 2013-05-07 12:39:05 -07:00
parent 92ceb93e93
commit 5762b85dd2

View File

@ -963,8 +963,6 @@ the specific language governing permissions and limitations under the Apache Lic
// sync enabled state
//console.log("sync enabled: ", this._enabled, "readonly: ", this._readonly);
var disabled = el.prop("disabled");
if (disabled === undefined) disabled = false;
this.enable(!disabled);
@ -1161,6 +1159,8 @@ the specific language governing permissions and limitations under the Apache Lic
if (this.opened()) return false;
if (this._enabled === false || this._readonly === true) return false;
event = $.Event("select2-opening");
this.opts.element.trigger(event);
return !event.isDefaultPrevented();