diff core/modules/toolbar/js/models/ToolbarModel.js @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/modules/toolbar/js/models/ToolbarModel.js	Wed Nov 29 16:09:58 2017 +0000
@@ -0,0 +1,45 @@
+/**
+* DO NOT EDIT THIS FILE.
+* See the following change record for more information,
+* https://www.drupal.org/node/2815083
+* @preserve
+**/
+
+(function (Backbone, Drupal) {
+  Drupal.toolbar.ToolbarModel = Backbone.Model.extend({
+    defaults: {
+      activeTab: null,
+
+      activeTray: null,
+
+      isOriented: false,
+
+      isFixed: false,
+
+      areSubtreesLoaded: false,
+
+      isViewportOverflowConstrained: false,
+
+      orientation: 'horizontal',
+
+      locked: false,
+
+      isTrayToggleVisible: true,
+
+      height: null,
+
+      offsets: {
+        top: 0,
+        right: 0,
+        bottom: 0,
+        left: 0
+      }
+    },
+
+    validate: function validate(attributes, options) {
+      if (attributes.orientation === 'horizontal' && this.get('locked') && !options.override) {
+        return Drupal.t('The toolbar cannot be set to a horizontal orientation when it is locked.');
+      }
+    }
+  });
+})(Backbone, Drupal);
\ No newline at end of file