Mercurial > hg > isophonics-drupal-site
view core/modules/contextual/js/models/StateModel.js @ 13:5fb285c0d0e3
Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've
been lucky to get away with this so far, as we don't support self-registration
which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5
was vulnerable to.
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:33:26 +0100 |
parents | 4c8ae668cc8c |
children |
line wrap: on
line source
/** * DO NOT EDIT THIS FILE. * See the following change record for more information, * https://www.drupal.org/node/2815083 * @preserve **/ (function (Drupal, Backbone) { Drupal.contextual.StateModel = Backbone.Model.extend({ defaults: { title: '', regionIsHovered: false, hasFocus: false, isOpen: false, isLocked: false }, toggleOpen: function toggleOpen() { var newIsOpen = !this.get('isOpen'); this.set('isOpen', newIsOpen); if (newIsOpen) { this.focus(); } return this; }, close: function close() { this.set('isOpen', false); return this; }, focus: function focus() { this.set('hasFocus', true); var cid = this.cid; this.collection.each(function (model) { if (model.cid !== cid) { model.close().blur(); } }); return this; }, blur: function blur() { if (!this.get('isOpen')) { this.set('hasFocus', false); } return this; } }); })(Drupal, Backbone);