diff options
author | Marc Bennewitz <github@mabe.berlin> | 2014-11-17 09:06:54 +0100 |
---|---|---|
committer | Marc Bennewitz <github@mabe.berlin> | 2014-11-17 09:06:54 +0100 |
commit | 4fde74456d694c6baab9e7730b46fa1eaa7a7096 (patch) | |
tree | eba5309c3364618c4b1db9a5ad9daf8175247265 | |
parent | a7473b5a2dc6a46abf8c09f84b8736d446610d3c (diff) | |
download | multiple-select-4fde74456d694c6baab9e7730b46fa1eaa7a7096.zip multiple-select-4fde74456d694c6baab9e7730b46fa1eaa7a7096.tar.gz multiple-select-4fde74456d694c6baab9e7730b46fa1eaa7a7096.tar.bz2 |
Current selected element not displayed in newer jquery versions
... without jquery.migrate.
It's because it's using `that.$el.attr("selected") == "selected"` on single selects.
I have changed that to `$elm.prop('selected')` (same as on multi selects) and it works fine for me but I don't know why it was explicitly using another element variable and the `attr()` function for `selected`.
-rw-r--r-- | jquery.multiple.select.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/jquery.multiple.select.js b/jquery.multiple.select.js index 03db7db..8380055 100644 --- a/jquery.multiple.select.js +++ b/jquery.multiple.select.js @@ -124,7 +124,7 @@ if ($elm.is('option')) { var value = $elm.val(), text = that.options.textTemplate($elm), - selected = (that.$el.attr('multiple') != undefined) ? $elm.prop('selected') : ($elm.attr('selected') == 'selected'), + selected = $elm.prop('selected'), style = this.options.styler(value) ? ' style="' + this.options.styler(value) + '"' : ''; disabled = groupDisabled || $elm.prop('disabled'); |