[New Edit Mode] Code style fixes
JSLint error
This commit is contained in:
@@ -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));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user