Skip to content

Commit

Permalink
rename _template functions to _html
Browse files Browse the repository at this point in the history
  • Loading branch information
koenpunt committed Oct 20, 2016
1 parent fecc9c4 commit f6db804
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions coffee/chosen.jquery.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ class Chosen extends AbstractChosen
@container.width this.container_width()

if @is_multiple
@container.html this.get_multi_template()
@container.html this.get_multi_html()
else
@container.html this.get_single_template()
@container.html this.get_single_html()

@form_field_jq.hide().after @container
@dropdown = @container.find('div.chosen-drop').first()
Expand Down Expand Up @@ -430,7 +430,7 @@ class Chosen extends AbstractChosen
this.result_do_highlight do_high if do_high?

no_results: (terms) ->
no_results_html = this.get_no_results_template(terms)
no_results_html = this.get_no_results_html(terms)
@search_results.append no_results_html
@form_field_jq.trigger("chosen:no_results", {chosen:this})

Expand Down
6 changes: 3 additions & 3 deletions coffee/chosen.proto.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class @Chosen extends AbstractChosen
super()

# HTML Templates
@no_results_temp = new Template(this.get_no_results_template('#{terms}'))
@no_results_temp = new Template(this.get_no_results_html('#{terms}'))

set_up_html: ->
container_classes = ["chosen-container"]
Expand All @@ -27,9 +27,9 @@ class @Chosen extends AbstractChosen
@container.setStyle(width: this.container_width())

if @is_multiple
@container.update this.get_multi_template()
@container.update this.get_multi_html()
else
@container.update this.get_single_template()
@container.update this.get_single_html()

@form_field.hide().insert({ after: @container })
@dropdown = @container.down('div.chosen-drop')
Expand Down
6 changes: 3 additions & 3 deletions coffee/lib/abstract-chosen.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ class AbstractChosen
tmp.appendChild(element)
tmp.innerHTML

get_single_template: ->
get_single_html: ->
"""
<a class="chosen-single chosen-default">
<span>#{@default_text}</span>
Expand All @@ -347,7 +347,7 @@ class AbstractChosen
</div>
"""

get_multi_template: ->
get_multi_html: ->
"""
<ul class="chosen-choices">
<li class="search-field">
Expand All @@ -359,7 +359,7 @@ class AbstractChosen
</div>
"""

get_no_results_template: (terms) ->
get_no_results_html: (terms) ->
"""
<li class="no-results">
#{@results_none_found} <span>#{terms}</span>
Expand Down

0 comments on commit f6db804

Please # to comment.