Skip to content

Commit 4f76947

Browse files
committed
A few more changes post-review
1 parent 515e520 commit 4f76947

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

frontend/assets/user_defined_in_basic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function UserDefinedInBasic() {
22
}
33

4-
UserDefinedInBasic.prototype.init = function(record_type, fields, read_only_view) {
4+
UserDefinedInBasic.prototype.init = function(fields, read_only_view) {
55
var bi = $("#basic_information");
66

77
if (bi.length == 0) {

frontend/views/layout_head.html.erb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ end
1010
<%= javascript_include_tag "#{AppConfig[:frontend_prefix]}assets/user_defined_in_basic.js" %>
1111

1212
<script>
13-
var record_type = '<%= controller.controller_name %>';
1413
var fields = <%= ASUtils.to_json(map_user_defined_to_labels(AppConfig[:user_defined_in_basic].fetch(controller.controller_name, []))).html_safe %>;
1514
var read_only_view = <%= controller.action_name == 'show' %>;
1615

1716
var init = function () {
17+
// Funny setTimeout here to move our initialization to the
18+
// end of the page load. We need this to run after the user
19+
// defined field subform is in and its buttons have been wired
20+
// up.
1821
setTimeout(function () {
19-
new UserDefinedInBasic().init(record_type, fields, read_only_view);
22+
new UserDefinedInBasic().init(fields, read_only_view);
2023
}, 0);
2124
}
2225

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
<%
22
section_id = "user_defined" if section_id.blank?
3-
if !defined?(context) || !context
4-
context = {}
5-
end
63
%>
74

85
<section id="<%= section_id %>" class="subrecord-form-dummy">
96
<h3><%= I18n.t("user_defined._singular") %></h3>
107

118
<div class="subrecord-form-container">
129
<div class="subrecord-form-fields">
13-
<%= read_only_view(user_defined, 'parent' => context['jsonmodel_type']) %>
10+
<%= read_only_view(user_defined) %>
1411
</div>
1512
</div>
1613
</section>

0 commit comments

Comments
 (0)