Skip to content

Commit

Permalink
Refactor to remove limit on roles (#175)
Browse files Browse the repository at this point in the history
* Refactor to remove limit on roles

* bump
  • Loading branch information
kevinchappell authored Jun 22, 2016
1 parent 7ff1a64 commit 0aedc76
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion assets/css/form-builder.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
formBuilder - http://kevinchappell.github.io/formBuilder/
Version: 1.10.1
Version: 1.10.2
Author: Kevin Chappell <[email protected]>
*/
@charset "UTF-8";
Expand Down
2 changes: 1 addition & 1 deletion assets/css/form-builder.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/form-render.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
formBuilder - http://kevinchappell.github.io/formBuilder/
Version: 1.10.1
Version: 1.10.2
Author: Kevin Chappell <[email protected]>
*/
* {
Expand Down
2 changes: 1 addition & 1 deletion assets/css/form-render.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/css/site.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions assets/js/form-builder.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
formBuilder - http://kevinchappell.github.io/formBuilder/
Version: 1.10.1
Version: 1.10.2
Author: Kevin Chappell <[email protected]>
*/
'use strict';
Expand Down Expand Up @@ -1823,6 +1823,7 @@ function formBuilderEventsFn() {
var advFields = function advFields(values) {
var advFields = [],
key,
checked = '',
roles = values.role !== undefined ? values.role.split(',') : [];

// var fieldLabelLabel = _helpers.markup('label', opts.messages.label);
Expand Down Expand Up @@ -1861,10 +1862,12 @@ function formBuilderEventsFn() {
advFields.push('<div class="available-roles" ' + (values.role !== undefined ? 'style="display:block"' : '') + '>');

for (key in opts.roles) {
if ($.inArray(key, ['date', '4']) === -1) {
advFields.push('<input type="checkbox" name="roles[]" value="' + key + '" id="fld-' + lastID + '-roles-' + key + '" ' + ($.inArray(key, roles) !== -1 ? 'checked' : '') + ' class="roles-field" /><label for="fld-' + lastID + '-roles-' + key + '">' + opts.roles[key] + '</label><br/>');
if (opts.roles.hasOwnProperty(key)) {
checked = _helpers.inArray(key, roles) ? 'checked' : '';
advFields.push('<input type="checkbox" name="roles[]" value="' + key + '" id="fld-' + lastID + '-roles-' + key + '" ' + checked + ' class="roles-field" /><label for="fld-' + lastID + '-roles-' + key + '">' + opts.roles[key] + '</label><br/>');
}
}

advFields.push('</div></div>');

if (values.type === 'checkbox-group' || values.type === 'radio-group') {
Expand Down
6 changes: 3 additions & 3 deletions assets/js/form-builder.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/form-render.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
formBuilder - http://kevinchappell.github.io/formBuilder/
Version: 1.10.1
Version: 1.10.2
Author: Kevin Chappell <[email protected]>
*/
'use strict';
Expand Down
Loading

0 comments on commit 0aedc76

Please sign in to comment.