Sha256: 0cefad9dd4b865d802e5f9fb8dd814db2e6ef38614b32cd0b22da29250192cd3
Contents?: true
Size: 836 Bytes
Versions: 3
Compression:
Stored size: 836 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() { if (!this.options.disabled) { this.model.set(this.options.propertyName, this.ui.input.is(':checked')); } }, load: function() { this.ui.input.attr('checked', this.displayValue()); }, displayValue: function() { if (this.options.disabled && this.options.displayUncheckedIfDisabled) { return false; } else { return this.model.get(this.options.propertyName); } } });
Version data entries
3 entries across 3 versions & 1 rubygems