Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/quickedit/js/views/EntityDecorationView.es6.js @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children |
comparison
equal
deleted
inserted
replaced
3:307d7a7fd348 | 4:a9cd425dd02b |
---|---|
1 /** | 1 /** |
2 * @file | 2 * @file |
3 * A Backbone view that decorates the in-place editable entity. | 3 * A Backbone view that decorates the in-place editable entity. |
4 */ | 4 */ |
5 | 5 |
6 (function (Drupal, $, Backbone) { | 6 (function(Drupal, $, Backbone) { |
7 Drupal.quickedit.EntityDecorationView = Backbone.View.extend(/** @lends Drupal.quickedit.EntityDecorationView# */{ | 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 }, | |
8 | 19 |
9 /** | 20 /** |
10 * Associated with the DOM root node of an editable entity. | 21 * @inheritdoc |
11 * | 22 */ |
12 * @constructs | 23 render() { |
13 * | 24 this.$el.toggleClass( |
14 * @augments Backbone.View | 25 'quickedit-entity-active', |
15 */ | 26 this.model.get('isActive'), |
16 initialize() { | 27 ); |
17 this.listenTo(this.model, 'change', this.render); | 28 }, |
29 | |
30 /** | |
31 * @inheritdoc | |
32 */ | |
33 remove() { | |
34 this.setElement(null); | |
35 Backbone.View.prototype.remove.call(this); | |
36 }, | |
18 }, | 37 }, |
19 | 38 ); |
20 /** | 39 })(Drupal, jQuery, Backbone); |
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)); |