mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 22:13:32 -04:00
Made the guide, when it shows up the first time, only show the first doc.
This commit is contained in:
parent
f24ee98295
commit
042fd7ac0d
2 changed files with 6 additions and 1 deletions
app/views/play
|
@ -13,6 +13,7 @@ module.exports = class DocsModal extends View
|
|||
'enter': 'hide'
|
||||
|
||||
constructor: (options) ->
|
||||
@firstOnly = options.firstOnly
|
||||
@docs = options?.docs
|
||||
general = @docs.generalArticles or []
|
||||
specific = @docs.specificArticles or []
|
||||
|
@ -25,6 +26,7 @@ module.exports = class DocsModal extends View
|
|||
|
||||
@docs = specific.concat(general)
|
||||
@docs = $.extend(true, [], @docs)
|
||||
@docs = [@docs[0]] if @firstOnly and @docs[0]
|
||||
doc.html = marked(utils.i18n doc, 'body') for doc in @docs
|
||||
doc.name = (utils.i18n doc, 'name') for doc in @docs
|
||||
doc.slug = _.string.slugify(doc.name) for doc in @docs
|
||||
|
|
|
@ -133,7 +133,10 @@ module.exports = class PlayLevelView extends View
|
|||
showGuide: ->
|
||||
@seenDocs = true
|
||||
DocsModal = require './level/modal/docs_modal'
|
||||
options = {docs: @levelLoader.level.get('documentation'), supermodel: @supermodel}
|
||||
options =
|
||||
docs: @levelLoader.level.get('documentation')
|
||||
supermodel: @supermodel
|
||||
firstOnly: true
|
||||
@openModalView(new DocsModal(options), true)
|
||||
Backbone.Mediator.subscribeOnce 'modal-closed', @onLevelStarted, @
|
||||
return true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue