Skip to content

Commit

Permalink
Dont check for abandon changes within the form
Browse files Browse the repository at this point in the history
Tweaked changes from previous commit to avoid abandon changes prompt when switching between tabs within the form(for the tabs that tabs are part of form)

Issue #6213
  • Loading branch information
h-kataria committed Nov 20, 2019
1 parent 6b3f64d commit 0feea60
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/assets/javascripts/miq_application.js
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,8 @@ function miq_tabs_init(id, url, parms) {
return sum + '&' + key + '=' + value;
}, '?tab_id=' + currTabTarget);

if (miqCheckForChanges()) {
var editMode = typeof parms !== 'undefined' && parms['edit_mode'] !== 'undefined' && parms['edit_mode'] === 'true';
if (editMode || miqCheckForChanges()) {
miqObserveRequest(url + urlParams, {beforeSend: true})
.catch(function (err) {
add_flash(__('Error requesting data from server'), 'error');
Expand Down
2 changes: 1 addition & 1 deletion app/views/miq_request/_prov_wf.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
= render :partial => "/miq_request/prov_host_dialog", :locals => partial_locals

:javascript
miq_tabs_init('#prov_tabs', '/miq_request/prov_field_changed');
miq_tabs_init('#prov_tabs', '/miq_request/prov_field_changed', {edit_mode: 'true'});

2 changes: 1 addition & 1 deletion app/views/ops/_ap_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@
= miq_tab_content('event_log', @sb[:ap_active_tab]) do
= render :partial => "ap_form_nteventlog", :locals => {:entry => entry, :edit => edit}
:javascript
miq_tabs_init('#ap_tabs', '/ops/ap_set_active_tab');
miq_tabs_init('#ap_tabs', '/ops/ap_set_active_tab', {edit_mode: 'true'});

0 comments on commit 0feea60

Please sign in to comment.