Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new #241

Open
wants to merge 140 commits into
base: gh-pages
Choose a base branch
from
Open

new #241

Changes from 1 commit
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
35764d6
changed it for the bootstrap
Mar 19, 2014
8043919
Removed saveFormButton, added Signature element
tristankenney Mar 22, 2014
b8d5ec9
Various changes
tristankenney Apr 14, 2014
d58e829
Bug fixes
tristankenney Apr 22, 2014
0844a40
POWER TIME
tristankenney Apr 30, 2014
c421a9b
Merge branch 'master' of github.com:crusepartnership/formbuilder
tristankenney Apr 30, 2014
d4c3c1b
Grid element + info element + icon prefix
tristankenney May 23, 2014
6f2e323
Children can be rendered in flat structure
tristankenney May 26, 2014
78e6fd1
Bug and styling fixes
tristankenney May 27, 2014
6c87744
'options per row' and fixes
tristankenney Jul 24, 2014
cd641b0
WIP
tristankenney Nov 27, 2014
5be27be
That'll do pig
tristankenney Nov 29, 2014
ee82a3a
Now with table and datasource
tristankenney Apr 14, 2015
47c83ba
Updated to summernote 0.6.16 and added link item to info element
Aug 31, 2015
b16f25c
Update for info field + set version for karma
Aug 31, 2015
9abe8f1
Removed multiple from datasource
tristankenney Sep 29, 2015
c6a9af8
Merge branch 'master' of github.com:crusepartnership/formbuilder
tristankenney Sep 30, 2015
493fdb4
Added option to grid element (first row headings)
Oct 14, 2015
8615a03
Merge remote-tracking branch 'origin/master'
Oct 14, 2015
150b73c
Updated .gitignore
tristankenney Oct 15, 2015
70e581c
Added ability to set heading colours for elements in tables [INTEGRAL…
Dec 3, 2015
870c31c
Merge remote-tracking branch 'origin/master'
Dec 3, 2015
74d33ec
Updates for ability to set heading colours for elements in tables [IN…
Dec 8, 2015
3a4580e
INTEGRALCS-3790 INTEGRALCS-3791 Inform Element Improvements
Dec 22, 2015
7ea36ab
Updated default time label
tristankenney Jan 3, 2016
f22ea40
fix the issue for dulication feature INTEGRALCS-3961
Mar 8, 2016
68035e6
Added conditional question
tristankenney Apr 19, 2017
fd7857f
Updated styling + conditional options
tristankenney Apr 23, 2017
221d5c4
Added styling to paarent
tristankenney Apr 23, 2017
026c56d
Fixed issues with issues repeatedly being registered
tristankenney Apr 25, 2017
b16649f
Added tooltip init code
tristankenney Apr 25, 2017
aa62cbe
Added toggle to conditional functionality
tristankenney Apr 26, 2017
d406bca
Added condtional display to section element
tristankenney May 6, 2017
6b5bde6
Added padding to bottom of the formbuilder
tristankenney May 11, 2017
d4592e3
Merge pull request #1 from crusepartnership/padding-fix
tristankenney May 11, 2017
7c9c778
Rebuilt and merged with master
tristankenney May 11, 2017
1910483
Uncommented table
tristankenney May 11, 2017
d8d6895
Merge pull request #2 from crusepartnership/conditional-functionality
tristankenney May 11, 2017
7fd605d
Add get geolocation button
lukeluluke May 12, 2017
d61e12b
add label and descrption for Geolocation element
lukeluluke May 16, 2017
2c6e0c7
change name of geolocation element type to lower case
lukeluluke May 16, 2017
d5bf05a
Add Reference ID to formbuilder field, and show reference id in Condi…
lukeluluke Aug 10, 2017
0713367
Merge pull request #3 from crusepartnership/add_geolocation
tristankenney Aug 10, 2017
24db0f8
Move Reference ID to end of header [INTEGRALCS-5847]
lukeluluke Aug 10, 2017
a143f40
Merge remote-tracking branch 'origin/master' into element-add-referen…
tristankenney Aug 17, 2017
6d0c899
fix for conditional functionality parent child question [INTEGRALCS-5…
Aug 28, 2017
74ccaab
Merge pull request #6 from crusepartnership/conditional-functionality…
tristankenney Aug 29, 2017
cc0452e
Merge pull request #4 from crusepartnership/element-add-referenceId
tristankenney Aug 29, 2017
695df50
Rebuilt post-merge
tristankenney Aug 29, 2017
00dc0c9
fix the issue for conditional display [SUPPORT-778] (#9)
raycui2011 Dec 20, 2017
e1daab5
fix the issue for element can not be removed in the table [SUPPORT-84…
raycui2011 Jan 5, 2018
f2fc899
use global variable to store the element for index[INTEGRALCS-6231]
Jan 24, 2018
7e57962
fix typo [INTEGRALCS-6231]
Jan 24, 2018
6f1b7a9
FormBuilder performance improvements
Jan 24, 2018
07901d3
Add HTML stripping (#14)
chintogtokh Nov 2, 2018
c7d06c1
Fix for formbuilder index issue
raycui2011 Dec 3, 2018
157bb62
Merge pull request #17 from crusepartnership/formbuilder-wrapper-inde…
Dec 3, 2018
34dc63e
Add fixes to correctly convert slash n to br [INTEGRALCS-8877]
chintogtokh Jan 30, 2019
4da6a39
Merge pull request #18 from crusepartnership/integralcs-8877-nl2br
lukeluluke Jan 30, 2019
bac5003
Add minor fix
chintogtokh Jan 30, 2019
4076dd7
Re-add commit c7d06c1 fixes to dist and coffeescript
chintogtokh Feb 11, 2019
2b585f3
Fix issue with info element [INTEGRALCS-9842]
chintogtokh May 15, 2019
18777d2
Add comments/readme
chintogtokh May 16, 2019
6f82e76
Re-add foxes from CLIENTHUB-1748 to coffeescript [CLIENTHUB-1748]
chintogtokh May 16, 2019
b38f88d
Make info description print raw - note that this has to be handled se…
chintogtokh May 16, 2019
3454889
Revert index.html
chintogtokh May 17, 2019
2613ed2
Merge pull request #20 from crusepartnership/integralcs-9842-formbuilder
chintogtokh May 17, 2019
6ebf934
Make formbuilder runs on server [INTEGRALCS-10486]
lukeluluke Oct 4, 2019
07b1e7c
Make formbuilder runs on server [INTEGRALCS-10486]
lukeluluke Oct 10, 2019
b8101c4
Merge pull request #21 from crusepartnership/integralcs-10486-inform-…
lukeluluke Nov 11, 2019
80401e6
Updated geolocation not to use non_input type, and given that this co…
Feb 27, 2020
25cc43f
Add currently known issues notes to readme in anticipation of future …
Feb 27, 2020
b80f095
Merge pull request #22 from crusepartnership/integralcs-13751-add-req…
raycui2011 Mar 2, 2020
64497b4
Approval Element [INTEGRALCS-13869]
lukeluluke Apr 20, 2020
5f2233e
Approval Element [INTEGRALCS-13869]
lukeluluke Apr 21, 2020
9c3f476
Approval Element [INTEGRALCS-13869]
lukeluluke Apr 22, 2020
4ea64c1
Approval Element [INTEGRALCS-13869]
lukeluluke Apr 23, 2020
8d5692e
Approval Element [INTEGRALCS-13869]
lukeluluke Apr 24, 2020
f382db7
Approval Element [INTEGRALCS-13869]
lukeluluke Apr 27, 2020
2d13f21
Approval Element [INTEGRALCS-13869]
lukeluluke May 12, 2020
3305e75
Approval Element [INTEGRALCS-13869]
lukeluluke May 12, 2020
53f138c
Approval Element [INTEGRALCS-13869]
lukeluluke May 14, 2020
c15aa2d
Approval Element [INTEGRALCS-13869]
lukeluluke Jun 2, 2020
cd17c45
Approval Element [INTEGRALCS-13869]
lukeluluke Jul 1, 2020
522c87b
Merge pull request #23 from crusepartnership/integralcs-13869-approva…
lukeluluke Jul 6, 2020
03d16b6
Update copy function of form builder [INTEGRALCS-16025]
lukeluluke Jul 23, 2020
279283c
Merge pull request #24 from crusepartnership/integralcs-16025-copy-el…
lukeluluke Jul 26, 2020
2796d81
Check parent exists for conditional question [INTEGRALCS-16025]
lukeluluke Jul 27, 2020
d8201b8
Merge pull request #25 from crusepartnership/integralcs-16068-conditi…
lukeluluke Jul 29, 2020
099354c
Add inline image option [INTEGRALCS-15217]
chintogtokh Sep 17, 2020
9493a33
Remove minified etc
chintogtokh Sep 17, 2020
dcb9550
Photo Setting UI
chintogtokh Sep 30, 2020
8f4a401
Info element photo
chintogtokh Oct 1, 2020
f386318
Updated formbuilder with new logic to allow Text and Paragraph elemen…
Oct 7, 2020
3d26201
Merge pull request #27 from crusepartnership/integralcs-16591-make-in…
paulzala Oct 9, 2020
85872cf
As part of a phased deprecation of Grid elements in Inform, don't all…
Oct 12, 2020
f692d57
Update comment. [INTEGRALCS-16590]
Oct 12, 2020
6a089ce
Merge branch 'master' into integralcs-15217-inline-imgs
chintogtokh Oct 13, 2020
051e667
Fix up
chintogtokh Oct 13, 2020
55b46bb
Modified the way formbuilder renders 'add' buttons, so that they have…
Oct 15, 2020
efc23f1
Merge pull request #28 from crusepartnership/integralcs-16590-purge-i…
paulzala Oct 19, 2020
8e49696
Formbuilder updates including an update to disallow grid duplication,…
Oct 29, 2020
09a1e84
Requested fixes [INTEGRALCS-15217]
chintogtokh Oct 30, 2020
8d7a931
Merge branch 'master' into integralcs-15217-inline-imgs
chintogtokh Oct 30, 2020
167cfa3
Remove the uglify doc [INTEGRALCS-15217]
chintogtokh Oct 30, 2020
d2f11b1
Merge pull request #29 from crusepartnership/integralcs-17212-disallo…
paulzala Nov 4, 2020
90348f6
Merge branch 'master' into integralcs-15217-inline-imgs
chintogtokh Nov 6, 2020
619e1a0
Required images need a required form element [INTEGRALCS-15217]
chintogtokh Nov 27, 2020
692a490
Fix
chintogtokh Dec 1, 2020
055ca4c
Update main.coffee
raycui2011 Dec 2, 2020
8ae4c38
Update formbuilder.js
raycui2011 Dec 2, 2020
ac89974
Update formbuild.js
raycui2011 Dec 2, 2020
85dcb7d
Allow Form builder elements dragged in from the add button to slot in…
Dec 15, 2020
3834732
Commit the minified js file. [INTEGRALCS-17268]
Dec 15, 2020
d575cb2
Merge pull request #31 from crusepartnership/integralcs-17268-form-de…
paulzala Dec 15, 2020
db87070
Update coffee [INTEGRALCS-17267]
raycui2011 Dec 15, 2020
649e5bc
Allow info photo requiredness
chintogtokh Dec 16, 2020
01c787c
Merge pull request #26 from crusepartnership/integralcs-15217-inline-…
chintogtokh Dec 17, 2020
4f96e1b
Added new logic to allow for Inline Actions inside Info, Text and Tex…
Jan 5, 2021
6ab7346
Update coffee [INTEGARLCS-17267]
raycui2011 Jan 19, 2021
9f34473
Update coffee script according to code review [INTEGRALCS-17267]
raycui2011 Feb 4, 2021
66c8fea
Merge branch 'master' into integralcs-17267-fix-conditional-functiona…
raycui2011 Feb 4, 2021
9334b21
Merge pull request #30 from crusepartnership/integralcs-17267-fix-con…
raycui2011 Feb 8, 2021
43e52e9
Merge branch 'master' into integralcs-17481-inform-inline-actions
Feb 9, 2021
06161ed
Merge pull request #32 from crusepartnership/integralcs-17481-inform-…
paulzala Feb 24, 2021
75562df
Updated summernote from 0.6.16 to 0.8.18. Corrected formbuilder info …
Mar 3, 2021
f8e84c2
Update to perform extra handling of link urls where the user can inse…
Mar 5, 2021
4d8ad5c
Update to perform extra handling of link urls. [INTEGRALCS-14556]
Mar 5, 2021
c2ae65f
Remove some logs that had snuck into vendor.js. [INTEGRALCS-14556]
Mar 5, 2021
bd1a05d
Merge pull request #33 from crusepartnership/integralcs-14556-update-…
paulzala Mar 9, 2021
b0b5402
Enforce target="_blank" to be added on existing links that are opened…
Mar 12, 2021
477e9ec
Merge pull request #34 from crusepartnership/integralcs-18892-infobox…
paulzala Mar 16, 2021
041c2bb
Remove auto save
raycui2011 Jul 7, 2021
d22f7bf
Reverting an unnecessary change to vendor.css. [INTEGRALCS-17821]
Jul 15, 2021
27a6d2a
Merge pull request #36 from crusepartnership/integralcs-17821-remove-…
paulzala Jul 28, 2021
e8cefea
Upped inform question version: reference_id field from 10 to 32 chars…
Sep 13, 2021
82b0d02
Increase Question Reference id to 32 characters in Form builder [INTE…
caleobryan Sep 17, 2021
daa5b61
UI fixes - put max-height on dropdown/radio/checkbox options element …
Oct 11, 2021
2f4df52
New cssmin file. [INTEGRALCS-20270]
Oct 11, 2021
7012f98
Merge pull request #38 from crusepartnership/integralcs-20270-inform-…
paulzala Oct 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated styling + conditional options
tristankenney committed Apr 23, 2017
commit fd7857fee63039a9806c14652e44c5a824e88204
3 changes: 3 additions & 0 deletions dist/formbuilder.css
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
.fb-icon-text:before{content:'\e80a'}
.fb-icon-number:before{content:'\e80b'}
.fb-icon-time:before{content:'\e80c'}
.fb-icon-conditional:before{content:'\E80D'}
.fb-button{text-align:left}
.fb-clear{clear:both}
.fb-main{padding:0 20px 0 0;position:relative}
@@ -65,6 +66,8 @@ input[readonly]{cursor:not-allowed;background-color:#eee}
.fb-common-wrapper .fb-label-description{margin-bottom:10px}
.fb-common-wrapper .fb-label-description input,.fb-common-wrapper .fb-label-description textarea{width:100%}
.fb-common-wrapper .fb-label-description textarea{min-height:5em}
.fb-conditional-question{float:right;font-size:.9em;max-width:50%;text-overflow:ellipsis;height:20px;white-space:nowrap;overflow:hidden}
.fb-conditional-question-trigger > span{font-weight:bold}
.option-score-input{width:50px}
.option-label-input{width:170px}
.response-field-draggable-helper{border:1px dashed #ddd;background:#eee}
95 changes: 71 additions & 24 deletions dist/formbuilder.js
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
this.callback = function() {
var currentValue, newValue;
currentValue = _.clone(_this.model.get(_this.keypath)) || [];
if (el.value && _.contains(currentValue, el.value)) {
if (_.contains(currentValue, el.value)) {
newValue = _.without(currentValue, el.value);
return _this.model.set(_this.keypath, newValue);
} else {
@@ -77,7 +77,8 @@
(function() {
var BuilderView, EditFieldView, Formbuilder, FormbuilderCollection, FormbuilderModel, GridFieldView, TableFieldView, ViewFieldView, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };

FormbuilderModel = (function(_super) {
__extends(FormbuilderModel, _super);
@@ -132,6 +133,44 @@
return parent && parent.get('type') === 'grid';
};

FormbuilderModel.prototype.canBeConditionallyDisplayed = function() {
return !this.inTable() && !this.inGrid();
};

FormbuilderModel.prototype.conditionalParent = function() {
var parentUuid;
parentUuid = this.get(Formbuilder.options.mappings.CONDITIONAL_PARENT);
if (parentUuid) {
return this.collection.findWhereUuid(parentUuid);
}
return null;
};

FormbuilderModel.prototype.answers = function() {
return this.get('answers') || [];
};

FormbuilderModel.prototype.conditionalTriggerOptions = function(selected) {
var options, parent, triggerValues;
parent = this.conditionalParent();
options = [];
if (parent) {
options = _.clone(parent.answers());
options.unshift({
'uuid': '',
'label': '[No Selection]'
});
if (selected) {
triggerValues = this.get(Formbuilder.options.mappings.CONDITIONAL_VALUES) || [];
options = _.filter(options, function(trigger) {
var _ref1;
return _ref1 = trigger.uuid, __indexOf.call(triggerValues, _ref1) >= 0;
});
}
}
return options;
};

FormbuilderModel.prototype.attachMethods = function() {
if (typeof this.attributes.initialize === 'function') {
this.attributes.initialize.call(this);
@@ -205,26 +244,6 @@
return items;
};

FormbuilderCollection.prototype.findConditionalTriggerOptions = function(child) {
var options, parentUuid;
parentUuid = child.get(Formbuilder.options.mappings.CONDITIONAL_PARENT);
options = [];
if (parentUuid) {
options = _.chain(this.findConditionalTriggers(child)).filter(function(trigger) {
return trigger.get('uuid') === parentUuid;
}).map(function(trigger) {
return trigger.get('answers');
}).flatten(true).value();
options.unshift({
'uuid': null,
label: '[No Selection] <span type="button" class="btn-xs btn-link" data-toggle="tooltip" data-placement="bottom" title="If selected, this element will display when the triggering element has no value">\
<span class="glyphicon glyphicon-question-sign"></span>\
</span>'
});
}
return options;
};

return FormbuilderCollection;

})(Backbone.Collection);
@@ -2104,7 +2123,7 @@ var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
with (obj) {

if (!rf.inTable() && !rf.inGrid()) { ;
if (rf.canBeConditionallyDisplayed()) { ;
__p += '\n\n\n<div class=\'fb-edit-section-header\'>Conditionally Display?\n <span type="button" class="btn btn-link" data-toggle="tooltip" data-placement="bottom" title="Checkbox, Radio and Dropdown elements can be used to conditionally trigger the display of elements">\n <span class="glyphicon glyphicon-question-sign"></span>\n </span>\n</div>\n';
var list = rf.collection.findConditionalTriggers(rf);
if (list.length) {
@@ -2123,7 +2142,8 @@ __p += '\n <option value="' +
__p += '\n</select>\n';


var selectedList = rf.collection.findConditionalTriggerOptions(rf)
var selectedList = rf.conditionalTriggerOptions();


for (i in selectedList) { ;
__p += '\n<label class="checkbox">\n <input type=\'checkbox\' data-rv-append=\'model.' +
@@ -2573,6 +2593,8 @@ obj || (obj = {});
var __t, __p = '', __e = _.escape;
with (obj) {
__p += '<div class=\'subtemplate-wrapper\'>\n <div class=\'cover\'></div>\n ' +
((__t = ( Formbuilder.templates['view/conditional']({rf: rf}) )) == null ? '' : __t) +
'\n ' +
((__t = ( Formbuilder.templates['view/label']({rf: rf}) )) == null ? '' : __t) +
'\n\n ' +
((__t = ( Formbuilder.fields[rf.get(Formbuilder.options.mappings.TYPE)].view({rf: rf}) )) == null ? '' : __t) +
@@ -2591,6 +2613,8 @@ obj || (obj = {});
var __t, __p = '', __e = _.escape;
with (obj) {
__p += '<div class=\'subtemplate-wrapper\'>\n <div class=\'cover\'></div>\n ' +
((__t = ( Formbuilder.templates['view/conditional']({rf: rf}) )) == null ? '' : __t) +
'\n ' +
((__t = ( Formbuilder.fields[rf.get(Formbuilder.options.mappings.TYPE)].view({rf: rf}) )) == null ? '' : __t) +
'\n ' +
((__t = ( Formbuilder.templates['view/duplicate_remove']({rf: rf}) )) == null ? '' : __t) +
@@ -2600,6 +2624,29 @@ __p += '<div class=\'subtemplate-wrapper\'>\n <div class=\'cover\'></div>\n '
return __p
};

this["Formbuilder"]["templates"]["view/conditional"] = function(obj) {
obj || (obj = {});
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
with (obj) {


var parent = rf.conditionalParent();
var triggerValues = _.pluck(rf.conditionalTriggerOptions(true), 'label');
if (parent && triggerValues.length) {
;
__p += '\n<div class="fb-conditional-question">\n <i class="fb-icon-conditional"></i>\n <span class="fb-conditional-question-trigger">display when <span>' +
((__t = ( parent.get('label') )) == null ? '' : __t) +
'</span> is <span>' +
((__t = ( triggerValues.join(' or ') )) == null ? '' : __t) +
'</span></span>\n</div>\n';
} ;
__p += '\n';

}
return __p
};

this["Formbuilder"]["templates"]["view/description"] = function(obj) {
obj || (obj = {});
var __t, __p = '', __e = _.escape;
35 changes: 22 additions & 13 deletions src/scripts/main.coffee
Original file line number Diff line number Diff line change
@@ -19,6 +19,27 @@ class FormbuilderModel extends Backbone.DeepModel
inGrid:() ->
parent = @parentModel()
parent and parent.get('type') is 'grid'
canBeConditionallyDisplayed:() -> !@inTable() and !@inGrid()
conditionalParent: () ->
parentUuid = @get(Formbuilder.options.mappings.CONDITIONAL_PARENT)
if parentUuid
return @collection.findWhereUuid(parentUuid)
null

answers: () -> @get('answers') || []

conditionalTriggerOptions: (selected) ->
parent = @conditionalParent()
options = []
if parent
options = _.clone(parent.answers())
options.unshift({'uuid': '', 'label': '[No Selection]'})
if selected
triggerValues = @get(Formbuilder.options.mappings.CONDITIONAL_VALUES) || []
options = _.filter options, (trigger) -> trigger.uuid in triggerValues

options


attachMethods: ()->
if typeof @attributes.initialize is 'function'
@@ -63,19 +84,7 @@ class FormbuilderCollection extends Backbone.Collection
hasNoParent = !model.hasParent()
correctType and differentModel and hasNoParent
items
findConditionalTriggerOptions: (child) ->
parentUuid = child.get(Formbuilder.options.mappings.CONDITIONAL_PARENT)
options = []
if parentUuid
options = _.chain(@findConditionalTriggers(child))
.filter((trigger) -> trigger.get('uuid') == parentUuid)
.map((trigger) -> trigger.get('answers'))
.flatten(true)
.value()
options.unshift({'uuid': null, label: '[No Selection] <span type="button" class="btn-xs btn-link" data-toggle="tooltip" data-placement="bottom" title="If selected, this element will display when the triggering element has no value">
<span class="glyphicon glyphicon-question-sign"></span>
</span>'})
options




2 changes: 1 addition & 1 deletion src/scripts/rivets-config.coffee
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ rivets.binders.append =

@callback = () =>
currentValue = _.clone(@model.get(@keypath)) || []
if el.value and _.contains(currentValue, el.value)
if _.contains(currentValue, el.value)
newValue = _.without(currentValue, el.value)
@model.set(@keypath, newValue)
else
17 changes: 16 additions & 1 deletion src/styles/formbuilder.styl
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@ $editing-border = darken($editing-bg, 7%)
.fb-icon-text:before { content: '\e80a'; } /* '' */
.fb-icon-number:before { content: '\e80b'; } /* '' */
.fb-icon-time:before { content: '\e80c'; } /* '' */
.fb-icon-conditional:before { content: '\E80D'; } /* '' */

.fb-button {
text-align: left;
@@ -349,6 +350,20 @@ input[readonly] {
min-height: 5em;
}

.fb-conditional-question {
float: right;
font-size: .9em;
max-width: 50%;
text-overflow: ellipsis;
height: 20px;
white-space: nowrap;
overflow: hidden;
}

.fb-conditional-question-trigger > span {
font-weight: bold;
}

.option-score-input {
width: 50px;
}
@@ -533,4 +548,4 @@ for row in (1..15)
width: 100%;
}
}
}
}
5 changes: 3 additions & 2 deletions src/templates/edit/conditional_options.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% if (!rf.inTable() && !rf.inGrid()) { %>
<% if (rf.canBeConditionallyDisplayed()) { %>


<div class='fb-edit-section-header'>Conditionally Display?
@@ -22,7 +22,8 @@
</select>
<%

var selectedList = rf.collection.findConditionalTriggerOptions(rf)
var selectedList = rf.conditionalTriggerOptions();


for (i in selectedList) { %>
<label class="checkbox">
1 change: 1 addition & 0 deletions src/templates/view/base.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<div class='subtemplate-wrapper'>
<div class='cover'></div>
<%= Formbuilder.templates['view/conditional']({rf: rf}) %>
<%= Formbuilder.templates['view/label']({rf: rf}) %>

<%= Formbuilder.fields[rf.get(Formbuilder.options.mappings.TYPE)].view({rf: rf}) %>
1 change: 1 addition & 0 deletions src/templates/view/base_non_input.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<div class='subtemplate-wrapper'>
<div class='cover'></div>
<%= Formbuilder.templates['view/conditional']({rf: rf}) %>
<%= Formbuilder.fields[rf.get(Formbuilder.options.mappings.TYPE)].view({rf: rf}) %>
<%= Formbuilder.templates['view/duplicate_remove']({rf: rf}) %>
</div>
10 changes: 10 additions & 0 deletions src/templates/view/conditional.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<%
var parent = rf.conditionalParent();
var triggerValues = _.pluck(rf.conditionalTriggerOptions(true), 'label');
if (parent && triggerValues.length) {
%>
<div class="fb-conditional-question">
<i class="fb-icon-conditional"></i>
<span class="fb-conditional-question-trigger">display when <span><%= parent.get('label') %></span> is <span><%= triggerValues.join(' or ') %></span></span>
</div>
<% } %>
Binary file modified vendor/fonts/fontello.eot
100644 → 100755
Binary file not shown.
42 changes: 28 additions & 14 deletions vendor/fonts/fontello.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vendor/fonts/fontello.ttf
100644 → 100755
Binary file not shown.
Binary file modified vendor/fonts/fontello.woff
100644 → 100755
Binary file not shown.
Binary file added vendor/fonts/fontello.woff2
Binary file not shown.