remove unused "load" treestore attribute

This commit is contained in:
Anton Dyudin 2015-07-20 12:42:54 -07:00
parent 0ef3333095
commit 02a4057ba9
3 changed files with 4 additions and 20 deletions

View File

@ -9,11 +9,6 @@ module.exports =
body:body body:body
kids:kids kids:kids
setLoading: (state) ->
TreeDispatcher.handleViewAction
type:"set-load"
load:state
loadKids: (path,kids) -> loadKids: (path,kids) ->
TreeDispatcher.handleServerAction TreeDispatcher.handleServerAction
type:"kids-load" type:"kids-load"
@ -34,7 +29,7 @@ module.exports =
if path.slice(-1) is "/" then path = path.slice(0,-1) if path.slice(-1) is "/" then path = path.slice(0,-1)
TreePersistence.get path,query,(err,res) => TreePersistence.get path,query,(err,res) =>
switch query switch query
when "snip" when "snip"
@loadSnip path,res.snip @loadSnip path,res.snip
@ -47,4 +42,4 @@ module.exports =
setCurr: (path) -> setCurr: (path) ->
TreeDispatcher.handleViewAction TreeDispatcher.handleViewAction
type:"set-curr" type:"set-curr"
path:path path:path

View File

@ -9,7 +9,6 @@ recl = React.createClass
module.exports = recl module.exports = recl
stateFromStore: -> stateFromStore: ->
body:TreeStore.getBody() body:TreeStore.getBody()
load:TreeStore.getLoad()
curr:TreeStore.getCurr() curr:TreeStore.getCurr()
cont:TreeStore.getCont() cont:TreeStore.getCont()
@ -30,9 +29,7 @@ module.exports = recl
getPath: (path) -> getPath: (path) ->
if not @state.cont[path]? if not @state.cont[path]?
TreeActions.setLoading true TreeActions.getPath path
TreeActions.getPath path,=>
TreeActions.setLoading false
render: -> render: ->
parts = [] parts = []
@ -40,4 +37,4 @@ module.exports = recl
parts.push (div {id:'body',key:"body"+@state.curr}, parts.push (div {id:'body',key:"body"+@state.curr},
(@state.body ? (div {className:"loading"}, (load {}, "")))) (@state.body ? (div {className:"loading"}, (load {}, ""))))
(div {}, parts) (div {}, parts)

View File

@ -5,7 +5,6 @@ MessageDispatcher = require '../dispatcher/Dispatcher.coffee'
_tree = {} _tree = {}
_cont = {} _cont = {}
_snip = {} _snip = {}
_load = false
_curr = "" _curr = ""
TreeStore = _.extend EventEmitter.prototype, { TreeStore = _.extend EventEmitter.prototype, {
@ -41,10 +40,6 @@ TreeStore = _.extend EventEmitter.prototype, {
getCont: -> _cont getCont: -> _cont
setLoad: (load) -> _load = load
getLoad: -> _load
mergePathToTree: (path,kids) -> mergePathToTree: (path,kids) ->
_obj = {} _obj = {}
@pathToObj path,_obj,kids @pathToObj path,_obj,kids
@ -149,8 +144,5 @@ TreeStore.dispatchToken = MessageDispatcher.register (payload) ->
when 'set-curr' when 'set-curr'
TreeStore.setCurr action.path TreeStore.setCurr action.path
TreeStore.emitChange() TreeStore.emitChange()
when 'set-load'
TreeStore.setLoad action.load
TreeStore.emitChange()
module.exports = TreeStore module.exports = TreeStore