Allow new item description files to be created
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user