Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have AbstractChosen and SelectParser available from window #1814

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions coffee/lib/abstract-chosen.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AbstractChosen
class window.AbstractChosen

constructor: (@form_field, @options={}) ->
return unless AbstractChosen.browser_is_supported()
Expand Down Expand Up @@ -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
Expand All @@ -164,7 +164,7 @@ class AbstractChosen
option.search_text = text.substr(0, startpos) + '<em>' + 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

Expand Down Expand Up @@ -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) ->
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions coffee/lib/select-parser.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class SelectParser
class window.SelectParser

constructor: ->
@options_index = 0
Expand Down Expand Up @@ -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
parser.parsed