diff --git a/coffee/lib/abstract-chosen.coffee b/coffee/lib/abstract-chosen.coffee index e4a3c8d555f..11683835032 100644 --- a/coffee/lib/abstract-chosen.coffee +++ b/coffee/lib/abstract-chosen.coffee @@ -1,4 +1,4 @@ -class AbstractChosen +class window.AbstractChosen constructor: (@form_field, @options={}) -> return unless AbstractChosen.browser_is_supported() @@ -150,7 +150,7 @@ class AbstractChosen results_group = @results_data[option.group_array_index] results += 1 if results_group.active_options is 0 and results_group.search_match results_group.active_options += 1 - + unless option.group and not @group_search option.search_text = if option.group then option.label else option.html @@ -164,7 +164,7 @@ class AbstractChosen option.search_text = text.substr(0, startpos) + '' + text.substr(startpos) results_group.group_match = true if results_group? - + else if option.group_array_index? and @results_data[option.group_array_index].search_match option.search_match = true @@ -194,7 +194,7 @@ class AbstractChosen @selected_option_count = 0 for option in @form_field.options @selected_option_count += 1 if option.selected - + return @selected_option_count choices_click: (evt) -> @@ -252,7 +252,7 @@ class AbstractChosen tmp.appendChild(element) tmp.innerHTML - # class methods and variables ============================================================ + # class methods and variables ============================================================ @browser_is_supported: -> if window.navigator.appName == "Microsoft Internet Explorer" diff --git a/coffee/lib/select-parser.coffee b/coffee/lib/select-parser.coffee index a4fe3b9e803..9cf7c89115a 100644 --- a/coffee/lib/select-parser.coffee +++ b/coffee/lib/select-parser.coffee @@ -1,4 +1,4 @@ -class SelectParser +class window.SelectParser constructor: -> @options_index = 0 @@ -61,4 +61,4 @@ class SelectParser SelectParser.select_to_array = (select) -> parser = new SelectParser() parser.add_node( child ) for child in select.childNodes - parser.parsed \ No newline at end of file + parser.parsed