|
Lines 84-89
define(['i18n!orion/navigate/nls/messages', 'require', 'orion/Deferred', 'orion/
Link Here
|
| 84 |
var progress = this.registry.getService("orion.page.progress"); |
84 |
var progress = this.registry.getService("orion.page.progress"); |
| 85 |
progress.progress(this.fileClient.fetchChildren(parentItem.ChildrenLocation), "Fetching children of " + parentItem.Name).then( |
85 |
progress.progress(this.fileClient.fetchChildren(parentItem.ChildrenLocation), "Fetching children of " + parentItem.Name).then( |
| 86 |
function(children) { |
86 |
function(children) { |
|
|
87 |
if (self.destroyed) { return; } |
| 87 |
onComplete(self.processParent(parentItem, children)); |
88 |
onComplete(self.processParent(parentItem, children)); |
| 88 |
} |
89 |
} |
| 89 |
); |
90 |
); |
|
Lines 193-198
define(['i18n!orion/navigate/nls/messages', 'require', 'orion/Deferred', 'orion/
Link Here
|
| 193 |
Object.keys(this._modelListeners).forEach(function(eventType) { |
194 |
Object.keys(this._modelListeners).forEach(function(eventType) { |
| 194 |
_self.modelEventDispatcher.removeEventListener(eventType, _self._modelListeners[eventType]); |
195 |
_self.modelEventDispatcher.removeEventListener(eventType, _self._modelListeners[eventType]); |
| 195 |
}); |
196 |
}); |
|
|
197 |
mExplorer.Explorer.prototype.destroy.call(this); |
| 196 |
}; |
198 |
}; |
| 197 |
|
199 |
|
| 198 |
/** |
200 |
/** |
|
Lines 484-499
define(['i18n!orion/navigate/nls/messages', 'require', 'orion/Deferred', 'orion/
Link Here
|
| 484 |
return this.loadResourceList(this.treeRoot, forceExpand); |
486 |
return this.loadResourceList(this.treeRoot, forceExpand); |
| 485 |
} |
487 |
} |
| 486 |
var that = this; |
488 |
var that = this; |
| 487 |
var progress = this.registry.getService("orion.page.progress"); |
489 |
var deferred = new Deferred(); |
| 488 |
return progress.progress(this.fileClient.fetchChildren(parent.ChildrenLocation), "Fetching children of " + parent.Name).then(function(children) { |
490 |
parent.children = null; |
| 489 |
children = that.model.processParent(parent, children); |
491 |
this.model.getChildren(parent, function(children) { |
| 490 |
//If a key board navigator is hooked up, we need to sync up the model |
492 |
//If a key board navigator is hooked up, we need to sync up the model |
| 491 |
if(that.getNavHandler()){ |
493 |
if(that.getNavHandler()){ |
| 492 |
//that._initSelModel(); |
494 |
//that._initSelModel(); |
| 493 |
} |
495 |
} |
| 494 |
that.myTree.refresh.bind(that.myTree)(parent, children, forceExpand); |
496 |
that.myTree.refresh.bind(that.myTree)(parent, children, forceExpand); |
| 495 |
return new Deferred().resolve(children); |
497 |
deferred.resolve(children); |
| 496 |
}); |
498 |
}); |
|
|
499 |
return deferred; |
| 497 |
}; |
500 |
}; |
| 498 |
|
501 |
|
| 499 |
FileExplorer.prototype.isExpanded = function(item) { |
502 |
FileExplorer.prototype.isExpanded = function(item) { |
|
Lines 601-608
define(['i18n!orion/navigate/nls/messages', 'require', 'orion/Deferred', 'orion/
Link Here
|
| 601 |
var self = this; |
604 |
var self = this; |
| 602 |
return Deferred.when(root, |
605 |
return Deferred.when(root, |
| 603 |
function(root) { |
606 |
function(root) { |
| 604 |
self.treeRoot = {}; |
|
|
| 605 |
clearTimeout(progressTimeout); |
607 |
clearTimeout(progressTimeout); |
|
|
608 |
if (self.destroyed) { return; } |
| 609 |
self.treeRoot = {}; |
| 606 |
// copy properties from root json to our object |
610 |
// copy properties from root json to our object |
| 607 |
for (var property in root) { |
611 |
for (var property in root) { |
| 608 |
self.treeRoot[property] = root[property]; |
612 |
self.treeRoot[property] = root[property]; |