@@ -39,7 +39,7 @@ class Chosen extends AbstractChosen
39
39
if @is_multiple
40
40
@container .html ' <ul class="chzn-choices"><li class="search-field"><input type="text" value="' + @default_text + ' " class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop"><ul class="chzn-results"></ul></div>'
41
41
else
42
- @container .html ' <a href="javascript:void(0)" class="chzn-single chzn-default" tabindex="-1"><span>' + @default_text + ' </span><div><b></b></div></a><div class="chzn-drop"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>'
42
+ @container .html ' <a class="chzn-single chzn-default" tabindex="-1"><span>' + @default_text + ' </span><div><b></b></div></a><div class="chzn-drop"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>'
43
43
44
44
@form_field_jq .hide ().after @container
45
45
@dropdown = @container .find (' div.chzn-drop' ).first ()
@@ -231,10 +231,10 @@ class Chosen extends AbstractChosen
231
231
232
232
233
233
set_tab_index : (el ) ->
234
- if @form_field_jq . attr " tabindex "
235
- ti = @form_field_jq . attr " tabindex "
236
- @form_field_jq . attr " tabindex " , - 1
237
- @search_field . attr " tabindex " , ti
234
+ if @form_field . tabIndex
235
+ ti = @form_field . tabIndex
236
+ @form_field . tabIndex = - 1
237
+ @search_field [ 0 ]. tabIndex = ti
238
238
239
239
set_label_behavior : ->
240
240
@form_field_label = @form_field_jq .parents (" label" ) # first check for a parent label
@@ -272,7 +272,7 @@ class Chosen extends AbstractChosen
272
272
if item .disabled
273
273
choice .addClass ' search-choice-disabled'
274
274
else
275
- close_link = $ (' <a />' , { href : ' # ' , class : ' search-choice-close' , rel : item .array_index })
275
+ close_link = $ (' <a />' , { class : ' search-choice-close' , ' data-option-array-index ' : item .array_index })
276
276
close_link .click (evt) => this .choice_destroy_link_click (evt)
277
277
choice .append close_link
278
278
@@ -284,7 +284,7 @@ class Chosen extends AbstractChosen
284
284
this .choice_destroy $ (evt .target ) unless @is_disabled
285
285
286
286
choice_destroy : (link ) ->
287
- if this .result_deselect ( link . attr " rel " )
287
+ if this .result_deselect ( link[ 0 ]. getAttribute ( " data-option-array-index " ) )
288
288
this .show_search_field_default ()
289
289
290
290
this .results_hide () if @is_multiple and this .choices_count () > 0 and @search_field .val ().length < 1
0 commit comments