Merge branch 'master' into production

This commit is contained in:
Nick Winter 2016-05-24 13:55:20 -07:00
commit 75aba86864

View file

@ -31,8 +31,11 @@ module.exports = class Spell
@languages.javascript ?= p.source @languages.javascript ?= p.source
@name = p.name @name = p.name
@permissions = read: p.permissions?.read ? [], readwrite: p.permissions?.readwrite ? [] # teams @permissions = read: p.permissions?.read ? [], readwrite: p.permissions?.readwrite ? [] # teams
@team = @permissions.readwrite[0] ? 'common'
if @canWrite() if @canWrite()
@setLanguage options.language @setLanguage options.language
else if @otherSession and @team is @otherSession.get 'team'
@setLanguage @otherSession.get('submittedCodeLanguage') or @otherSession.get('codeLanguage')
else else
@setLanguage 'javascript' @setLanguage 'javascript'
@ -49,7 +52,6 @@ module.exports = class Spell
@view.render() # Get it ready and code loaded in advance @view.render() # Get it ready and code loaded in advance
@tabView = new SpellListTabEntryView spell: @, supermodel: @supermodel, codeLanguage: @language, level: options.level @tabView = new SpellListTabEntryView spell: @, supermodel: @supermodel, codeLanguage: @language, level: options.level
@tabView.render() @tabView.render()
@team = @permissions.readwrite[0] ? 'common'
Backbone.Mediator.publish 'tome:spell-created', spell: @ Backbone.Mediator.publish 'tome:spell-created', spell: @
destroy: -> destroy: ->