Security update to Drupal 8.4.6
[yaffs-website] / web / core / modules / quickedit / js / views / EntityDecorationView.es6.js
1 /**
2  * @file
3  * A Backbone view that decorates the in-place editable entity.
4  */
5
6 (function (Drupal, $, Backbone) {
7   Drupal.quickedit.EntityDecorationView = Backbone.View.extend(/** @lends Drupal.quickedit.EntityDecorationView# */{
8
9     /**
10      * Associated with the DOM root node of an editable entity.
11      *
12      * @constructs
13      *
14      * @augments Backbone.View
15      */
16     initialize() {
17       this.listenTo(this.model, 'change', this.render);
18     },
19
20     /**
21      * @inheritdoc
22      */
23     render() {
24       this.$el.toggleClass('quickedit-entity-active', this.model.get('isActive'));
25     },
26
27     /**
28      * @inheritdoc
29      */
30     remove() {
31       this.setElement(null);
32       Backbone.View.prototype.remove.call(this);
33     },
34
35   });
36 }(Drupal, jQuery, Backbone));