Only fetch images in edit mode
This commit is contained in:
@@ -24,6 +24,9 @@ module.exports = class MarkdownImageListController extends BaseController
|
||||
|
||||
# Public Methods ###############################################################################
|
||||
|
||||
fetchImages: ->
|
||||
@model.fetchImages()
|
||||
|
||||
getImageUrlForFile: (fileName)->
|
||||
@model.getFile(fileName).imageUrl
|
||||
|
||||
@@ -68,8 +71,6 @@ module.exports = class MarkdownImageListController extends BaseController
|
||||
super
|
||||
|
||||
refresh: ->
|
||||
@model.fetchImages()
|
||||
|
||||
@_controllers ?= []
|
||||
index = 0
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ module.exports = class MarkdownSectionController extends BaseController
|
||||
|
||||
logger.verbose => "MarkdownSectionController.#{@cid} changed state from #{oldState} to #{newState}"
|
||||
@trigger Event.change + ':state', this, oldState, newState
|
||||
@_updateStateVisibility()
|
||||
@tryRefresh()
|
||||
|
||||
Object.defineProperties @prototype,
|
||||
editable: { get:@prototype.isEditable }
|
||||
@@ -176,10 +176,13 @@ module.exports = class MarkdownSectionController extends BaseController
|
||||
refresh: ->
|
||||
@$title.html @title
|
||||
@_imageListController.markdownText = @model
|
||||
@_imageListController.fetchImages() if @state is State.editing
|
||||
|
||||
@_updateButtonStates()
|
||||
@_updateSizer()
|
||||
@_updatePreview()
|
||||
@_updateStateVisibility()
|
||||
|
||||
super
|
||||
|
||||
onWillChangeModel: (oldModel, newModel)->
|
||||
|
||||
Reference in New Issue
Block a user