Skip to content

Commit d441369

Browse files
committed
Inline a singly-used helper into vm_common
1 parent 31c45c1 commit d441369

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

app/controllers/vm_common.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def button
7676
javascript_flash(:spinner_off => true)
7777
else
7878
options
79-
partial_replace(@refresh_div, "vm_common/#{@refresh_partial}")
79+
"$(\"##{h(@refresh_div)}\").replaceWith(\"#{escape_javascript(render(:partial => "vm_common/#{@refresh_partial}"))}\");".html_safe
8080
end
8181
end
8282

@@ -580,7 +580,7 @@ def remove_service
580580

581581
def edit
582582
@record = find_record_with_rbac(VmOrTemplate, params[:id]) # Set the VM object
583-
583+
584584
# reset @explorer if coming from explorer views
585585
@edit ||= {}
586586
@edit[:explorer] = true if params[:action] == "x_button" || session.fetch_path(:edit, :explorer)

app/helpers/js_helper.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ def javascript_hide_if_exists(element)
4242
"if (miqDomElementExists('#{j_str(element)}')) #{javascript_hide(element)}".html_safe
4343
end
4444

45-
def partial_replace(from, partial, locals)
46-
"$(\"##{h(from)}\").replaceWith(\"#{escape_javascript(render(:partial => partial, :locals => locals))}\");".html_safe
47-
end
48-
4945
def javascript_checked(element)
5046
"if ($('##{j_str(element)}').prop('type') == 'checkbox') {$('##{j_str(element)}').prop('checked', true);}"
5147
.html_safe

0 commit comments

Comments
 (0)