drupal/core/modules/toolbar/js/models/ToolbarModel.js

49 lines
1.0 KiB
JavaScript
Raw Normal View History

/**
* DO NOT EDIT THIS FILE.
* All changes should be applied to ./modules/toolbar/js/models/ToolbarModel.es6.js
* See the following change record for more information,
* https://www.drupal.org/node/2873849
* @preserve
**/
(function (Backbone, Drupal) {
'use strict';
Drupal.toolbar.ToolbarModel = Backbone.Model.extend({
defaults: {
activeTab: null,
activeTray: null,
isOriented: false,
isFixed: false,
areSubtreesLoaded: false,
isViewportOverflowConstrained: false,
orientation: 'vertical',
locked: false,
isTrayToggleVisible: false,
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);