Skip to content

Commit

Permalink
Update other parts for select2 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
knu committed Nov 18, 2016
1 parent 835fe96 commit 26b1dc4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/assets/javascripts/components/core.js.coffee
Expand Up @@ -18,7 +18,7 @@ $ ->

$(".select2-linked-tags").select2(
width: 'resolve',
formatSelection: (obj) ->
templateSelection: (obj) ->
"<a href=\"#{this.element.data('urlPrefix')}/#{obj.id}/edit\" onClick=\"Utils.select2TagClickHandler(event, this)\">#{Utils.escape(obj.text)}</a>"
)

Expand All @@ -33,4 +33,4 @@ $ ->
sel.addRange(range)

# Agent navbar dropdown
$('.navbar .dropdown.dropdown-hover').hover (-> $(this).addClass('open')), (-> $(this).removeClass('open'))
$('.navbar .dropdown.dropdown-hover').hover (-> $(this).addClass('open')), (-> $(this).removeClass('open'))
7 changes: 4 additions & 3 deletions app/assets/javascripts/pages/scenario-form-page.js.coffee
Expand Up @@ -9,7 +9,8 @@ class @ScenarioFormPage
enabledSelect2: () ->
$('.select2-fountawesome-icon').select2
width: '100%'
formatResult: @format

escapeMarkup: (m) -> m
templateResult: @format

$ ->
Utils.registerPage(ScenarioFormPage, forPathsMatching: /^scenarios/)
Utils.registerPage(ScenarioFormPage, forPathsMatching: /^scenarios/)

0 comments on commit 26b1dc4

Please sign in to comment.