comparison core/modules/quickedit/js/views/EntityDecorationView.es6.js @ 0:c75dbcec494b

Initial commit from drush-created site
author Chris Cannam
date Thu, 05 Jul 2018 14:24:15 +0000
parents
children a9cd425dd02b
comparison
equal deleted inserted replaced
-1:000000000000 0:c75dbcec494b
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));