@@ -50,40 +50,40 @@ class @Chosen extends AbstractChosen
50
50
@form_field .fire (" chosen:ready" , {chosen : this })
51
51
52
52
register_observers : ->
53
- @container .observe " touchstart" , ( evt ) => this .container_mousedown (evt); evt . preventDefault ()
54
- @container .observe " touchend" , ( evt ) => this .container_mouseup (evt); evt . preventDefault ()
55
-
56
- @container .observe " mousedown" , ( evt ) => this .container_mousedown (evt)
57
- @container .observe " mouseup" , ( evt ) => this .container_mouseup (evt)
58
- @container .observe " mouseenter" , ( evt ) => this .mouse_enter (evt)
59
- @container .observe " mouseleave" , ( evt ) => this .mouse_leave (evt)
60
-
61
- @search_results .observe " mouseup" , ( evt ) => this .search_results_mouseup (evt)
62
- @search_results .observe " mouseover" , ( evt ) => this .search_results_mouseover (evt)
63
- @search_results .observe " mouseout" , ( evt ) => this .search_results_mouseout (evt)
64
- @search_results .observe " mousewheel" , ( evt ) => this .search_results_mousewheel (evt)
65
- @search_results .observe " DOMMouseScroll" , ( evt ) => this .search_results_mousewheel (evt)
66
-
67
- @search_results .observe " touchstart" , ( evt ) => this .search_results_touchstart (evt)
68
- @search_results .observe " touchmove" , ( evt ) => this .search_results_touchmove (evt)
69
- @search_results .observe " touchend" , ( evt ) => this .search_results_touchend (evt)
70
-
71
- @form_field .observe " chosen:updated" , ( evt ) => this .results_update_field (evt)
72
- @form_field .observe " chosen:activate" , this .activate_field
73
- @form_field .observe " chosen:open" , ( evt ) => this .container_mousedown (evt)
74
- @form_field .observe " chosen:close" , ( evt ) => this .close_field (evt)
75
-
76
- @search_field .observe " blur" , ( evt ) => this .input_blur (evt)
77
- @search_field .observe " keyup" , ( evt ) => this .keyup_checker (evt)
78
- @search_field .observe " keydown" , ( evt ) => this .keydown_checker (evt)
79
- @search_field .observe " focus" , ( evt ) => this .input_focus (evt)
80
- @search_field .observe " cut" , ( evt ) => this .clipboard_event_checker (evt)
81
- @search_field .observe " paste" , ( evt ) => this .clipboard_event_checker (evt)
53
+ @container .observe ' touchstart' , this .container_mousedown
54
+ @container .observe ' touchend' , this .container_mouseup
55
+
56
+ @container .observe ' mousedown' , this .container_mousedown
57
+ @container .observe ' mouseup' , this .container_mouseup
58
+ @container .observe ' mouseenter' , this .mouse_enter
59
+ @container .observe ' mouseleave' , this .mouse_leave
60
+
61
+ @search_results .observe ' mouseup' , this .search_results_mouseup
62
+ @search_results .observe ' mouseover' , this .search_results_mouseover
63
+ @search_results .observe ' mouseout' , this .search_results_mouseout
64
+ @search_results .observe ' mousewheel' , this .search_results_mousewheel
65
+ @search_results .observe ' DOMMouseScroll' , this .search_results_mousewheel
66
+
67
+ @search_results .observe ' touchstart' , this .search_results_touchstart
68
+ @search_results .observe ' touchmove' , this .search_results_touchmove
69
+ @search_results .observe ' touchend' , this .search_results_touchend
70
+
71
+ @form_field .observe ' chosen:updated' , this .results_update_field
72
+ @form_field .observe ' chosen:activate' , this .activate_field
73
+ @form_field .observe ' chosen:open' , this .container_mousedown
74
+ @form_field .observe ' chosen:close' , this .close_field
75
+
76
+ @search_field .observe ' blur' , this .input_blur
77
+ @search_field .observe ' keyup' , this .keyup_checker
78
+ @search_field .observe ' keydown' , this .keydown_checker
79
+ @search_field .observe ' focus' , this .input_focus
80
+ @search_field .observe ' cut' , this .clipboard_event_checker
81
+ @search_field .observe ' paste' , this .clipboard_event_checker
82
82
83
83
if @is_multiple
84
- @search_choices .observe " click" , ( evt ) => this .choices_click (evt)
84
+ @search_choices .observe ' click' , this .choices_click
85
85
else
86
- @container .observe " click" , (evt ) => evt .preventDefault () # gobble click of anchor
86
+ @container .observe ' click' , (evt ) => evt .preventDefault () # gobble click of anchor
87
87
88
88
destroy : ->
89
89
@container .ownerDocument .stopObserving ' click' , this .test_active_click
@@ -126,7 +126,7 @@ class @Chosen extends AbstractChosen
126
126
else unless @is_multiple
127
127
@selected_item .observe ' focus' , this .activate_field
128
128
129
- container_mousedown : (evt ) - >
129
+ container_mousedown : (evt ) = >
130
130
return if @is_disabled
131
131
132
132
if evt and evt .type is " mousedown" and not @results_showing
@@ -142,10 +142,10 @@ class @Chosen extends AbstractChosen
142
142
143
143
this .activate_field ()
144
144
145
- container_mouseup : (evt ) - >
145
+ container_mouseup : (evt ) = >
146
146
this .results_reset (evt) if evt .target .nodeName is " ABBR" and not @is_disabled
147
147
148
- search_results_mousewheel : (evt ) - >
148
+ search_results_mousewheel : (evt ) = >
149
149
delta = evt .deltaY or - evt .wheelDelta or evt .detail
150
150
if delta?
151
151
evt .preventDefault ()
@@ -155,7 +155,7 @@ class @Chosen extends AbstractChosen
155
155
blur_test : ->
156
156
this .close_field () if not @active_field and @container .hasClassName (" chosen-container-active" )
157
157
158
- close_field : - >
158
+ close_field : = >
159
159
@container .ownerDocument .stopObserving ' click' , this .test_active_click
160
160
161
161
@active_field = false
@@ -279,18 +279,18 @@ class @Chosen extends AbstractChosen
279
279
@search_field .value = " "
280
280
@search_field .removeClassName " default"
281
281
282
- search_results_mouseup : (evt ) - >
282
+ search_results_mouseup : (evt ) = >
283
283
target = if evt .target .hasClassName (" active-result" ) then evt .target else evt .target .up (" .active-result" )
284
284
if target
285
285
@result_highlight = target
286
286
this .result_select (evt)
287
287
@search_field .focus ()
288
288
289
- search_results_mouseover : (evt ) - >
289
+ search_results_mouseover : (evt ) = >
290
290
target = if evt .target .hasClassName (" active-result" ) then evt .target else evt .target .up (" .active-result" )
291
291
this .result_do_highlight ( target ) if target
292
292
293
- search_results_mouseout : (evt ) - >
293
+ search_results_mouseout : (evt ) = >
294
294
this .result_clear_highlight () if evt .target .hasClassName (' active-result' ) or evt .target .up (' .active-result' )
295
295
296
296
choice_build : (item ) ->
0 commit comments