[Common UI] Add skeleton specs for edit mode

Add empty files which will contain specs for
bundle platform/commonUI/edit, which is responsible
for Edit mode. WTD-574.
This commit is contained in:
Victor Woeltjen
2014-11-24 17:01:37 -08:00
parent 80430234d6
commit 88f3221938
14 changed files with 230 additions and 12 deletions

View File

@ -8,21 +8,23 @@ define(
function () {
"use strict";
var ACTION_CONTEXT = { category: 'conclude-editing' };
/**
* Controller which supplies action instances for Save/Cancel.
* @constructor
*/
function EditActionController($scope) {
// Maintain all "conclude-editing" actions in the present
// context.
function updateActions() {
if (!$scope.action) {
$scope.editActions = [];
} else {
$scope.editActions = $scope.action.getActions({
category: 'conclude-editing'
});
}
$scope.editActions = $scope.action ?
$scope.action.getActions(ACTION_CONTEXT) :
[];
}
// Update set of actions whenever the action capability
// changes or becomes available.
$scope.$watch("action", updateActions);
}

View File

@ -79,10 +79,6 @@ define(
// Save All. An infinite loop is avoided by marking
// objects as clean as we go.
function doSave(editCapability) {
return editCapability.save();
}
while (Object.keys(dirty).length > 0) {
// Pick the first dirty object
object = dirty[Object.keys(dirty)[0]];
@ -91,7 +87,7 @@ define(
this.markClean(object);
// Invoke its save behavior
object.getCapability('editor.completion').then(doSave);
object.getCapability('editor').save();
}
}
};