Sha256: 2682bc175d69d3a2aa206b83b6759991adf826776c6702a150098ef0f73d66a1

Contents?: true

Size: 621 Bytes

Versions: 10

Compression:

Stored size: 621 Bytes

Contents

pageflow.selectableView = {
  initialize: function() {
    this.listenTo(this.options.selection, 'change:' + this.model.modelName, function(selection, selectedModel) {
      this.$el.toggleClass('active', selectedModel === this.model);
    });

    this.$el.toggleClass('active', this.options.selection.get(this.model.modelName) === this.model);
  },

  select: function() {
    this.options.selection.set(this.model.modelName, this.model);
  },

  onClose: function() {
    if (this.options.selection.get(this.model.modelName) === this.model) {
      this.options.selection.set(this.model.modelName, null);
    }
  }
};

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pageflow-0.4.0 app/assets/javascripts/pageflow/editor/views/mixins/selectable_view.js
pageflow-0.3.0 app/assets/javascripts/pageflow/editor/views/mixins/selectable_view.js
pageflow-0.2.1 app/assets/javascripts/pageflow/editor/views/mixins/selectable_view.js
pageflow-0.2.0 app/assets/javascripts/pageflow/editor/views/mixins/selectable_view.js
pageflow-0.1.0 app/assets/javascripts/pageflow/editor/views/mixins/selectable_view.js
pageflow-0.0.5 app/assets/javascripts/pageflow/editor/views/mixins/selectable_view.js
pageflow-0.0.4 app/assets/javascripts/pageflow/editor/views/mixins/selectable_view.js
pageflow-0.0.3 app/assets/javascripts/pageflow/editor/views/mixins/selectable_view.js
pageflow-0.0.2 app/assets/javascripts/pageflow/editor/views/mixins/selectable_view.js
pageflow-0.0.1 app/assets/javascripts/pageflow/editor/views/mixins/selectable_view.js