Updated Drupal to 8.6. This goes with the following updates because it's possible...
[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(
8     /** @lends Drupal.quickedit.EntityDecorationView# */ {
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(
25           'quickedit-entity-active',
26           this.model.get('isActive'),
27         );
28       },
29
30       /**
31        * @inheritdoc
32        */
33       remove() {
34         this.setElement(null);
35         Backbone.View.prototype.remove.call(this);
36       },
37     },
38   );
39 })(Drupal, jQuery, Backbone);