From 5a1232532dc35feb351c9bf5ae0eabb05452ec51 Mon Sep 17 00:00:00 2001 From: Patrick Filler Date: Tue, 19 Jul 2011 17:01:41 -0400 Subject: [PATCH] Fix test for disabled elements. --- chosen/chosen.jquery.js | 5 +---- chosen/chosen.proto.js | 5 +---- coffee/chosen.jquery.coffee | 2 +- coffee/chosen.proto.coffee | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/chosen/chosen.jquery.js b/chosen/chosen.jquery.js index 3784ff2..5590ffc 100644 --- a/chosen/chosen.jquery.js +++ b/chosen/chosen.jquery.js @@ -701,7 +701,6 @@ return _results; }; SelectParser.prototype.add_option = function(option, group_position, group_disabled) { - var _ref; if (option.nodeName === "OPTION") { if (option.text !== "") { if (group_position != null) { @@ -713,9 +712,7 @@ value: option.value, text: option.text, selected: option.selected, - disabled: (_ref = group_disabled === true) != null ? _ref : { - group_disabled: option.disabled - }, + disabled: group_disabled === true ? group_disabled : option.disabled, group_array_index: group_position }); } else { diff --git a/chosen/chosen.proto.js b/chosen/chosen.proto.js index 8f8d9e1..ce7a917 100644 --- a/chosen/chosen.proto.js +++ b/chosen/chosen.proto.js @@ -720,7 +720,6 @@ return _results; }; SelectParser.prototype.add_option = function(option, group_position, group_disabled) { - var _ref; if (option.nodeName === "OPTION") { if (option.text !== "") { if (group_position != null) { @@ -732,9 +731,7 @@ value: option.value, text: option.text, selected: option.selected, - disabled: (_ref = group_disabled === true) != null ? _ref : { - group_disabled: option.disabled - }, + disabled: group_disabled === true ? group_disabled : option.disabled, group_array_index: group_position }); } else { diff --git a/coffee/chosen.jquery.coffee b/coffee/chosen.jquery.coffee index 5035e3f..7c76d8b 100644 --- a/coffee/chosen.jquery.coffee +++ b/coffee/chosen.jquery.coffee @@ -610,7 +610,7 @@ class SelectParser value: option.value text: option.text selected: option.selected - disabled: ((group_disabled is true) ? group_disabled : option.disabled) + disabled: if group_disabled is true then group_disabled else option.disabled group_array_index: group_position else @parsed.push diff --git a/coffee/chosen.proto.coffee b/coffee/chosen.proto.coffee index 8f01662..a8ad37e 100644 --- a/coffee/chosen.proto.coffee +++ b/coffee/chosen.proto.coffee @@ -608,7 +608,7 @@ class SelectParser value: option.value text: option.text selected: option.selected - disabled: ((group_disabled is true) ? group_disabled : option.disabled) + disabled: if group_disabled is true then group_disabled else option.disabled group_array_index: group_position else @parsed.push