Fixed a couple typos with failed resource loading handling.
This commit is contained in:
parent
c01bd69625
commit
a481af08d3
1 changed files with 4 additions and 4 deletions
|
@ -169,9 +169,9 @@ module.exports = class SuperModel extends Backbone.Model
|
||||||
_.defer @updateProgress
|
_.defer @updateProgress
|
||||||
r.clean()
|
r.clean()
|
||||||
|
|
||||||
onResourceFailed: (source) ->
|
onResourceFailed: (r) ->
|
||||||
return unless @resources[r.rid]
|
return unless @resources[r.rid]
|
||||||
@trigger('failed', source)
|
@trigger('failed', resource: r)
|
||||||
r.clean()
|
r.clean()
|
||||||
|
|
||||||
updateProgress: =>
|
updateProgress: =>
|
||||||
|
@ -216,14 +216,14 @@ class Resource extends Backbone.Model
|
||||||
|
|
||||||
markFailed: ->
|
markFailed: ->
|
||||||
return if @isLoaded
|
return if @isLoaded
|
||||||
@trigger('failed', {resource: @})
|
@trigger('failed', @)
|
||||||
@isLoaded = @isLoading = false
|
@isLoaded = @isLoading = false
|
||||||
@isFailed = true
|
@isFailed = true
|
||||||
|
|
||||||
markLoading: ->
|
markLoading: ->
|
||||||
@isLoaded = @isFailed = false
|
@isLoaded = @isFailed = false
|
||||||
@isLoading = true
|
@isLoading = true
|
||||||
|
|
||||||
clean: ->
|
clean: ->
|
||||||
# request objects get rather large. Clean them up after the request is finished.
|
# request objects get rather large. Clean them up after the request is finished.
|
||||||
@jqxhr = null
|
@jqxhr = null
|
||||||
|
|
Reference in a new issue