Sha256: 588062ff45abd1df677e32efffdd48cc6a7357ceb8895763f2453068cc040dae

Contents?: true

Size: 606 Bytes

Versions: 8

Compression:

Stored size: 606 Bytes

Contents

pageflow.CheckBoxInputView = Backbone.Marionette.ItemView.extend({
  mixins: [pageflow.inputView],

  template: 'templates/inputs/check_box',
  className: 'check_box_input',

  events: {
    'change': 'save'
  },

  ui: {
    input: 'input',
    label: 'label'
  },

  onRender: function() {
    this.ui.label.attr('for', this.cid);
    this.ui.input.attr('id', this.cid);
    this.load();
  },

  save: function() {
    this.model.set(this.options.propertyName, this.ui.input.is(':checked'));
  },

  load: function() {
    this.ui.input.attr('checked', this.model.get(this.options.propertyName));
  }
});

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pageflow-0.2.1 app/assets/javascripts/pageflow/editor/views/inputs/check_box_input_view.js
pageflow-0.2.0 app/assets/javascripts/pageflow/editor/views/inputs/check_box_input_view.js
pageflow-0.1.0 app/assets/javascripts/pageflow/editor/views/inputs/check_box_input_view.js
pageflow-0.0.5 app/assets/javascripts/pageflow/editor/views/inputs/check_box_input_view.js
pageflow-0.0.4 app/assets/javascripts/pageflow/editor/views/inputs/check_box_input_view.js
pageflow-0.0.3 app/assets/javascripts/pageflow/editor/views/inputs/check_box_input_view.js
pageflow-0.0.2 app/assets/javascripts/pageflow/editor/views/inputs/check_box_input_view.js
pageflow-0.0.1 app/assets/javascripts/pageflow/editor/views/inputs/check_box_input_view.js