Skip to content

Commit d14c1b1

Browse files
committed
Merge branch 'release/3.1.1'
2 parents a554015 + febd901 commit d14c1b1

File tree

2 files changed

+31
-15
lines changed

2 files changed

+31
-15
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
All notable changes to the Form Render Skip Logic module will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [3.1.1] - 2018-06-04
6+
### Changed
7+
- Fixing control field's 2nd column visibility. (Tiago Bember Simeao)
8+
9+
510
## [3.1.0] - 2018-06-02
611
### Added
712
- Add support for data piping and smart variables in place of a control field. (Tiago Bember Simeao & Philip Chase)

js/config.js

+26-15
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,25 @@ $(document).ready(function() {
1919

2020
$modal.addClass('frsl');
2121

22+
var place2ndColumnField = function($row) {
23+
if ($row.hasClass('frsl-moved') || !$row.is(':visible')) {
24+
return;
25+
}
26+
27+
var $element = $row.find('.external-modules-input-element');
28+
var $target = $row.prev().find('.external-modules-input-element');
29+
30+
$element.css('width', ($target.parent().width() - $target.outerWidth(true) - 10) + 'px');
31+
$element.position({
32+
my: 'left+10 top',
33+
at: 'right top',
34+
of: $target[0],
35+
collision: "none"
36+
});
37+
38+
$row.addClass('frsl-moved');
39+
}
40+
2241
var branchingLogicCheckboxes = function($checkbox) {
2342
var prefix = $checkbox.attr('name').replace('_select', '');
2443
$target = $modal.find('select[name^="' + prefix + '"]').parent().parent();
@@ -46,6 +65,8 @@ $(document).ready(function() {
4665

4766
$(selectorShow).parent().parent().show();
4867
$(selectorHide).parent().parent().hide();
68+
69+
place2ndColumnField($('[name="control_field_key' + suffix + '"]').parent().parent());
4970
};
5071

5172
var $checkboxes = $modal.find('tr[field="target_events_select"] .external-modules-input-element');
@@ -60,6 +81,9 @@ $(document).ready(function() {
6081
$modal.find('tr[field="control_mode"]').each(function() {
6182
var defaultValue = 'default';
6283
$(this).find('.external-modules-input-element').each(function() {
84+
// Not using ":checked" selector to get the selected radio
85+
// due to a possible bug on EM that unchecks radios within
86+
// repeatable elements.
6387
if (typeof this.attributes.checked !== 'undefined') {
6488
defaultValue = $(this).val();
6589
return false;
@@ -79,21 +103,8 @@ $(document).ready(function() {
79103
}
80104
});
81105

82-
$modal.find('tr[field="control_field_key"], tr[field="condition_value"]').each(function() {
83-
if (!$(this).is(':visible')) {
84-
return;
85-
}
86-
87-
var $element = $(this).find('.external-modules-input-element');
88-
var $target = $(this).prev().find('.external-modules-input-element');
89-
90-
$element.css('width', ($target.parent().width() - $target.outerWidth(true) - 10) + 'px');
91-
$element.position({
92-
my: 'left+10 top',
93-
at: 'right top',
94-
of: $target[0],
95-
collision: "none"
96-
});
106+
$modal.find('tr[field="condition_value"]').each(function() {
107+
place2ndColumnField($(this));
97108
});
98109
};
99110
});

0 commit comments

Comments
 (0)