-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckboxes.js
37 lines (32 loc) · 1.09 KB
/
checkboxes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
Backbone-Forms jQuery UI checkboxes editor 1.0.0
Copyright (c) 2016 Tomasz Jakub Rup
https://github.com/tomi77/backbone-forms-jquery-ui
Released under the MIT license
*/
(function(root, factory) {
/* istanbul ignore next */
switch (false) {
case !(typeof define === 'function' && define.amd):
define(['backbone-forms', 'jquery-ui/widgets/checkboxradio'], factory);
break;
case typeof exports !== 'object':
require('jquery-ui/widgets/checkboxradio');
factory(require('backbone-forms'));
break;
default:
factory(root.Backbone.Form);
}
})(this, function(Form) {
Form.editors['jqueryui.checkboxes'] = Form.editors.Checkboxes.extend({
className: 'bbf-jui-checkboxes',
initialize: function(options) {
Form.editors.Checkboxes.prototype.initialize.call(this, options);
this.editorOptions = this.schema.editorOptions || {};
},
renderOptions: function(options) {
Form.editors.Checkboxes.prototype.renderOptions.call(this, options);
this.$('input[type=checkbox]').checkboxradio(this.editorOptions);
}
});
});