[New Edit Mode] Code style fixes

JSLint error
This commit is contained in:
Henry
2016-01-14 15:53:10 -08:00
parent d78bd9fd51
commit f300b99b7b
8 changed files with 54 additions and 33 deletions

View File

@@ -75,7 +75,9 @@ define(
// urlService.urlForLocation used to adjust current
// path to new, addressed, path based on
// domainObject
$location.path(urlService.urlForLocation("browse", domainObject.hasCapability('editor') ? domainObject.getOriginalObject() : domainObject));
$location.path(urlService.urlForLocation("browse",
domainObject.hasCapability('editor') ?
domainObject.getOriginalObject() : domainObject));
}

View File

@@ -22,8 +22,10 @@
/*global define,Promise*/
define(
['../../../representation/src/gestures/GestureConstants',
'../../edit/src/objects/EditableDomainObject'],
[
'../../../representation/src/gestures/GestureConstants',
'../../edit/src/objects/EditableDomainObject'
],
function (GestureConstants, EditableDomainObject) {
"use strict";
@@ -50,17 +52,15 @@ define(
((domainObject && domainObject.useCapability('view')) || [])
.forEach(selectViewIfMatching);
}
//$scope.editMode = domainObject.hasCapability('editor') ?
// true : false;
navigatedObject = domainObject;
}
function updateQueryParam(viewKey) {
var unlisten,
priorRoute = $route.current,
editMode = $scope.domainObject && $scope.domainObject.hasCapability('editor');
isEditMode = $scope.domainObject && $scope.domainObject.hasCapability('editor');
if (viewKey && !editMode) {
if (viewKey && !isEditMode) {
$location.search('view', viewKey);
unlisten = $scope.$on('$locationChangeSuccess', function () {
// Checks path to make sure /browse/ is at front

View File

@@ -25,9 +25,11 @@
* Module defining CreateAction. Created by vwoeltje on 11/10/14.
*/
define(
['./CreateWizard',
'uuid',
'../../../edit/src/objects/EditableDomainObject'],
[
'./CreateWizard',
'uuid',
'../../../edit/src/objects/EditableDomainObject'
],
function (CreateWizard, uuid, EditableDomainObject) {
"use strict";

View File

@@ -98,9 +98,15 @@ define(
editableObject.getCapability("status").set("editing", false);
return nonrecursive ?
resolvePromise(doMutate()).then(doPersist).then(function(){self.cancel();}) :
resolvePromise(cache.saveAll());
if (nonrecursive) {
return resolvePromise(doMutate())
.then(doPersist)
.then(function(){
self.cancel();
});
} else {
return resolvePromise(cache.saveAll());
}
};
/**

View File

@@ -108,7 +108,6 @@ define(
this.key = (representation || {}).key;
// Track the represented object
this.domainObject = representedObject;
this.scope.editMode = representedObject.hasCapability("editor");
// Ensure existing watches are released
this.destroy();