Show loading state when checking for MD images

This commit is contained in:
Andrew Miner
2015-06-08 10:45:35 -07:00
parent 622f80d153
commit 3535c19db0
3 changed files with 37 additions and 12 deletions
@@ -7,6 +7,7 @@ All rights reserved.
_ = require 'underscore'
BaseController = require './base_controller'
{Duration} = require '../constants'
MarkdownImage = require '../models/markdown_image'
########################################################################################################################
@@ -57,10 +58,14 @@ module.exports = class MarkdownImageController extends BaseController
# BaseController Overrides #####################################################################
onDidRender: ->
@$image = @$('img')
@$fileName = @$('.fileName p')
@$button = @$('button')
@$input = @$('input')
@$image = @$('img')
@$fileName = @$('.fileName p')
@$button = @$('button')
@$input = @$('input')
@$errorContainer = @$('.error')
@$errorMessage = @$('.error p')
@$loaded = @$('.loaded')
@$loading = @$('.loading')
super
@@ -77,6 +82,13 @@ module.exports = class MarkdownImageController extends BaseController
else
@$button.html 'Choose'
if @model.status is MarkdownImage.Status.checking
@$loaded.hide duration:Duration.normal
@$loading.show duration:Duration.normal, queue:true
else
@$loading.hide duration:Duration.normal
@$loaded.show duration:Duration.normal, queue:true
super
# Backbone.View Overrides ######################################################################