Allow new item description files to be created

This commit is contained in:
Andrew Miner
2015-05-11 09:20:42 -07:00
parent 8eb5cef71b
commit 23e98f5d31
7 changed files with 75 additions and 34 deletions
@@ -148,7 +148,11 @@ module.exports = class ItemPageController extends PageController
@client.fetchFile path:GitHub.file.itemDescription modSlug:@_itemSlug.mod, itemSlug:@_itemSlug.item
.then (response)=>
@_editingFile = response.json.data
@model.item.parse @_editingFile.content
if @_editingFile.content.length > 0
@model.item.parse @_editingFile.content
else
@model.item.description = ''
@_descriptionController.model = @model.item.description
_endEditingDescription: ->
@@ -180,6 +184,8 @@ module.exports = class ItemPageController extends PageController
if @model.item?.description?.length > 0
@_descriptionController.model = @model.item.description
@show @$descriptionSection
else if @user?
@show @$descriptionSection
else
@hide @$descriptionSection