Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 420650
Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.client.ui/web/orion/explorers/explorer-table.js (-5 / +9 lines)
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];
(-)a/bundles/org.eclipse.orion.client.ui/web/orion/explorers/explorer.js (-3 / +11 lines)
Lines 38-43 exports.Explorer = (function() { Link Here
38
		this.myTree = null;
38
		this.myTree = null;
39
	}
39
	}
40
	Explorer.prototype = /** @lends orion.explorer.Explorer.prototype */ {
40
	Explorer.prototype = /** @lends orion.explorer.Explorer.prototype */ {
41
	
42
		destroy: function() {
43
			if (this.model) {
44
				this.model.destroy();
45
			}
46
			if (this.myTree) {
47
				this.myTree.destroy();
48
			}
49
			this.destroyed = true;
50
		},
41
		
51
		
42
		// we have changed an item on the server at the specified parent node
52
		// we have changed an item on the server at the specified parent node
43
		changedItem: function(parent, children) {
53
		changedItem: function(parent, children) {
Lines 311-316 exports.ExplorerModel = (function() { Link Here
311
	}
321
	}
312
	ExplorerModel.prototype = /** @lends orion.explorer.ExplorerModel.prototype */{
322
	ExplorerModel.prototype = /** @lends orion.explorer.ExplorerModel.prototype */{
313
		destroy: function(){
323
		destroy: function(){
324
			this.destroyed = true;
314
		},
325
		},
315
		getRoot: function(onItem){
326
		getRoot: function(onItem){
316
			var self = this;
327
			var self = this;
Lines 826-834 exports.SimpleFlatModel = (function() { Link Here
826
		onItem(this.root);
837
		onItem(this.root);
827
	};
838
	};
828
	
839
	
829
	SimpleFlatModel.prototype.destroy = function() {
830
	};
831
	
832
	SimpleFlatModel.prototype.getId = function(/* item */ item){
840
	SimpleFlatModel.prototype.getId = function(/* item */ item){
833
		var key = this.getKey(item);
841
		var key = this.getKey(item);
834
		// this might be a path, so strip slashes
842
		// this might be a path, so strip slashes
(-)a/bundles/org.eclipse.orion.client.ui/web/orion/webui/treetable.js (+7 lines)
Lines 84-95 define(['i18n!orion/nls/messages', 'orion/webui/littlelib'], function(messages, Link Here
84
				}
84
				}
85
				else {
85
				else {
86
					tree._treeModel.getChildren(root, function(children) {
86
					tree._treeModel.getChildren(root, function(children) {
87
						if (tree.destroyed) { return; }
87
						tree._generate(children, 0);
88
						tree._generate(children, 0);
88
					});
89
					});
89
				}
90
				}
90
			});
91
			});
91
		},
92
		},
92
		
93
		
94
		destroy: function() {
95
			this.destroyed = true;
96
		},
97
		
93
		_generate: function(children, indentLevel) {
98
		_generate: function(children, indentLevel) {
94
			lib.empty(this._parent);
99
			lib.empty(this._parent);
95
			var wrapper = document.createElement("div"); //$NON-NLS-0$
100
			var wrapper = document.createElement("div"); //$NON-NLS-0$
Lines 184-189 define(['i18n!orion/nls/messages', 'orion/webui/littlelib'], function(messages, Link Here
184
						} else {
189
						} else {
185
							tree = this;
190
							tree = this;
186
							children = this._treeModel.getChildren(row._item, function(children) {
191
							children = this._treeModel.getChildren(row._item, function(children) {
192
								if (tree.destroyed) { return; }
187
								if (!row._expanded) {
193
								if (!row._expanded) {
188
									row._expanded = true;
194
									row._expanded = true;
189
									tree._generateChildren(children, row._depth+1, row); //$NON-NLS-0$
195
									tree._generateChildren(children, row._depth+1, row); //$NON-NLS-0$
Lines 243-248 define(['i18n!orion/nls/messages', 'orion/webui/littlelib'], function(messages, Link Here
243
				var tree = this;
249
				var tree = this;
244
				this._renderer.updateExpandVisuals(row, true);
250
				this._renderer.updateExpandVisuals(row, true);
245
				this._treeModel.getChildren(row._item, function(children) {
251
				this._treeModel.getChildren(row._item, function(children) {
252
					if (tree.destroyed) { return; }
246
					if (!row._expanded) {
253
					if (!row._expanded) {
247
						row._expanded = true;
254
						row._expanded = true;
248
						tree._generateChildren(children, row._depth+1, row); //$NON-NLS-0$
255
						tree._generateChildren(children, row._depth+1, row); //$NON-NLS-0$

Return to bug 420650