From 77efda2c11a590032f67cfbca57fa377a0c29d67 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 14 Jan 2016 14:44:19 -0800 Subject: [PATCH] [New Edit Mode] JSLint --- platform/commonUI/edit/src/actions/SaveAction.js | 4 ++-- platform/commonUI/edit/src/policies/EditActionPolicy.js | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/platform/commonUI/edit/src/actions/SaveAction.js b/platform/commonUI/edit/src/actions/SaveAction.js index 13543beac8..25d8bce968 100644 --- a/platform/commonUI/edit/src/actions/SaveAction.js +++ b/platform/commonUI/edit/src/actions/SaveAction.js @@ -163,8 +163,8 @@ define( // this is introduced by EditableDomainObject which is // used to insulate underlying objects from changes made // during editing. + /*jshint es5: true */ function doSave() { - //WARNING: HACK //This is a new 'virtual object' that has not been persisted // yet. if (!domainObject.getModel().persisted){ @@ -178,7 +178,7 @@ define( .then(function(){ return fetchObject(domainObject.getId()); }) - .catch(doNothing) + .catch(doNothing); } else { return domainObject.getCapability("editor").save() .then(resolveWith(domainObject.getOriginalObject())); diff --git a/platform/commonUI/edit/src/policies/EditActionPolicy.js b/platform/commonUI/edit/src/policies/EditActionPolicy.js index 943f467327..a591945ae9 100644 --- a/platform/commonUI/edit/src/policies/EditActionPolicy.js +++ b/platform/commonUI/edit/src/policies/EditActionPolicy.js @@ -65,15 +65,13 @@ define( // A view is editable unless explicitly flagged as not (views || []).forEach(function (view) { - if (view.editable===false || (applicableView(view.key) && !editableType(type.getKey()))){ - // Do nothing - } else { + if (view.editable===true && !(applicableView(view.key) && !editableType(type.getKey()))){ count++; } }); return count; - } + }; /** * Checks whether the domain object is currently being edited. If