mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 01:55:38 -05:00
changing showDiplomatSuggestionModal function name and moving language build call to it from afterRender
This commit is contained in:
parent
1562b02fd1
commit
f00d9b2acc
1 changed files with 3 additions and 6 deletions
|
@ -15,13 +15,9 @@ filterKeyboardEvents = (allowedEvents, func) ->
|
|||
module.exports = class RootView extends CocoView
|
||||
events:
|
||||
"click #logout-button": "logoutAccount"
|
||||
'change .language-dropdown': 'showDiplomatSuggestionModal'
|
||||
'change .language-dropdown': 'onLanguageChanged'
|
||||
'click .toggle-fullscreen': 'toggleFullscreen'
|
||||
|
||||
afterRender: ->
|
||||
super()
|
||||
@buildLanguages()
|
||||
|
||||
logoutAccount: ->
|
||||
logoutUser($('#login-email').val())
|
||||
|
||||
|
@ -60,11 +56,12 @@ module.exports = class RootView extends CocoView
|
|||
$("<option></option>").val(code).text(localeInfo.nativeDescription))
|
||||
$select.val(preferred).fancySelect()
|
||||
|
||||
showDiplomatSuggestionModal: ->
|
||||
onLanguageChanged: ->
|
||||
newLang = $(".language-dropdown").val()
|
||||
$.i18n.setLng(newLang, {})
|
||||
@saveLanguage(newLang)
|
||||
@render()
|
||||
@buildLanguages()
|
||||
unless newLang.split('-')[0] is "en"
|
||||
@openModalView(application.router.getView("modal/diplomat_suggestion", "_modal"))
|
||||
|
||||
|
|
Loading…
Reference in a new issue