[Edit] Remove unused code

Remove unused and/or excessive code related to Save in Edit mode.
WTD-1033.
This commit is contained in:
Victor Woeltjen 2015-03-24 10:41:56 -07:00
parent eb869b7213
commit 821cc65d6f
2 changed files with 6 additions and 24 deletions

View File

@ -13,24 +13,18 @@ define(
function SaveAction($location, context) { function SaveAction($location, context) {
var domainObject = context.domainObject; var domainObject = context.domainObject;
// Look up the object's "editor.completion" capability; // Invoke any save behavior introduced by the editor capability;
// this is introduced by EditableDomainObject which is // this is introduced by EditableDomainObject which is
// used to insulate underlying objects from changes made // used to insulate underlying objects from changes made
// during editing. // during editing.
function getEditorCapability() { function doSave() {
return domainObject.getCapability("editor"); return domainObject.getCapability("editor").save();
}
// Invoke any save behavior introduced by the editor.completion
// capability.
function doSave(editor) {
return editor.save();
} }
// Discard the current root view (which will be the editing // Discard the current root view (which will be the editing
// UI, which will have been pushed atop the Browise UI.) // UI, which will have been pushed atop the Browise UI.)
function returnToBrowse() { function returnToBrowse() {
$location.path("/browse"); return $location.path("/browse");
} }
return { return {
@ -41,7 +35,7 @@ define(
* cancellation has completed * cancellation has completed
*/ */
perform: function () { perform: function () {
return doSave(getEditorCapability()).then(returnToBrowse); return doSave().then(returnToBrowse);
} }
}; };
} }

View File

@ -33,7 +33,7 @@ define(
// removed from the layer which gets dependency // removed from the layer which gets dependency
// injection. // injection.
function resolvePromise(value) { function resolvePromise(value) {
return value && value.then ? value : { return (value && value.then) ? value : {
then: function (callback) { then: function (callback) {
return resolvePromise(callback(value)); return resolvePromise(callback(value));
} }
@ -53,18 +53,6 @@ define(
return persistenceCapability.persist(); return persistenceCapability.persist();
} }
// Save any other objects that have been modified in the cache.
// IMPORTANT: This must not be called until after this object
// has been marked as clean.
function saveOthers() {
return cache.saveAll();
}
// Indicate that this object has been saved.
function markClean() {
return cache.markClean(editableObject);
}
return { return {
/** /**
* Save any changes that have been made to this domain object * Save any changes that have been made to this domain object