diff core/modules/quickedit/js/models/EntityModel.es6.js @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children 129ea1e6d783
line wrap: on
line diff
--- a/core/modules/quickedit/js/models/EntityModel.es6.js	Mon Apr 23 09:33:26 2018 +0100
+++ b/core/modules/quickedit/js/models/EntityModel.es6.js	Mon Apr 23 09:46:53 2018 +0100
@@ -189,9 +189,9 @@
           this.set('isActive', true);
           break;
 
-        case 'committing':
+        case 'committing': {
           // The user indicated they want to save the entity.
-          var fields = this.get('fields');
+          const fields = this.get('fields');
           // For fields that are in an active state, transition them to
           // candidate.
           fields.chain()
@@ -207,9 +207,10 @@
               fieldModel.set('state', 'saving');
             });
           break;
+        }
 
-        case 'deactivating':
-          var changedFields = this.get('fields')
+        case 'deactivating': {
+          const changedFields = this.get('fields')
             .filter(fieldModel => _.intersection([fieldModel.get('state')], ['changed', 'invalid']).length);
           // If the entity contains unconfirmed or unsaved changes, return the
           // entity to an opened state and ask the user if they would like to
@@ -250,6 +251,7 @@
             });
           }
           break;
+        }
 
         case 'closing':
           // Set all fields to the 'inactive' state.
@@ -364,7 +366,7 @@
           }
           break;
 
-        case 'committing':
+        case 'committing': {
           // If the field save returned a validation error, set the state of the
           // entity back to 'opened'.
           if (fieldState === 'invalid') {
@@ -380,7 +382,7 @@
 
           // Attempt to save the entity. If the entity's fields are not yet all
           // in a ready state, the save will not be processed.
-          var options = {
+          const options = {
             'accept-field-states': Drupal.quickedit.app.readyFieldStates,
           };
           if (entityModel.set('isCommitting', true, options)) {
@@ -404,6 +406,7 @@
             });
           }
           break;
+        }
 
         case 'deactivating':
           // When setting the entity to 'closing', require that all fieldModels