bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitChangeList.js
function() {
			if(!this.model.root) {
				return new Deferred().resolve(true);
			}
			var modelList = this.model.root.children || this.model.root.Children;
			if(!modelList) {
				return new Deferred().resolve(true);
			}
			var isDirty = modelList.some( function(child) {
				if(child.children && child.children.length === 1 && child.children[0].resourceComparer && child.children[0].resourceComparer.isDirty()) {
					return true;
				}
			});
			if(isDirty) {
				var dialog = this.registry.getService("orion.page.dialog");
				var d = new Deferred();
				dialog.confirm(messages.confirmUnsavedChanges, function(result){
					if(result){
						var promises = [];
						modelList.forEach( function(child) {
							if(child.children && child.children.length === 1 && child.children[0].resourceComparer && child.children[0].resourceComparer.isDirty() && child.children[0].resourceComparer.save) {
								promises.push(child.children[0].resourceComparer.save(true));
							}
						});				
						return d.resolve(Deferred.all(promises));
					}else{
						return d.resolve();
					}
				});
				return d;
			} else {
				return new Deferred().resolve(true);
			}
		}
function() {
			if(!this.model.root) {
				return new Deferred().resolve(true);
			}
			var modelList = this.model.root.children || this.model.root.Children;
			if(!modelList) {
				return new Deferred().resolve(true);
			}
			var isDirty = modelList.some( function(child) {
				if(child.children && child.children.length === 1 && child.children[0].resourceComparer && child.children[0].resourceComparer.isDirty()) {
					return true;
				}
			});
			if(isDirty) {
				var dialog = this.registry.getService("orion.page.dialog");
				var d = new Deferred();
				dialog.confirm(messages.confirmUnsavedChanges, function(result){
					if(result){
						var promises = [];
						modelList.forEach( function(child) {
							if(child.children && child.children.length === 1 && child.children[0].resourceComparer && child.children[0].resourceComparer.isDirty() && child.children[0].resourceComparer.save) {
								promises.push(child.children[0].resourceComparer.save(true));
							}
						});				
						return d.resolve(Deferred.all(promises));
					}else{
						return d.resolve();
					}
				});
				return d;
			} else {
				return new Deferred().resolve(true);
			}
		}
function ( ) { if ( ! this . model . root ) { return new Deferred ( ) . resolve ( true ) ; } var modelList = this . model . root . children || this . model . root . Children ; if ( ! modelList ) { return new Deferred ( ) . resolve ( true ) ; } var isDirty = modelList . some ( function ( child ) { if ( child . children && child . children . length === 1 && child . children [ 0 ] . resourceComparer && child . children [ 0 ] . resourceComparer . isDirty ( ) ) { return true ; } } ) ; if ( isDirty ) { var dialog = this . registry . getService ( "orion.page.dialog" ) ; var d = new Deferred ( ) ; dialog . confirm ( messages . confirmUnsavedChanges , function ( result ) { if ( result ) { var promises = [ ] ; modelList . forEach ( function ( child ) { if ( child . children && child . children . length === 1 && child . children [ 0 ] . resourceComparer && child . children [ 0 ] . resourceComparer . isDirty ( ) && child . children [ 0 ] . resourceComparer . save ) { promises . push ( child . children [ 0 ] . resourceComparer . save ( true ) ) ; } } ) ; return d . resolve ( Deferred . all ( promises ) ) ; } else { return d . resolve ( ) ; } } ) ; return d ; } else { return new Deferred ( ) . resolve ( true ) ; } }
This function is called when any of the compare widgets in the explorer are hooked up and need to be unhooked
This function is called when any of the compare widgets in the explorer are hooked up and need to be unhooked