Skip to content

Commit

Permalink
Confirmation popup is not needed on timelines screen.
Browse files Browse the repository at this point in the history
"Abandon changes?" confirmation is not needed when leaving Timelines screen

https://bugzilla.redhat.com/show_bug.cgi?id=1391220
  • Loading branch information
h-kataria committed Jan 12, 2017
1 parent a470992 commit bb666e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/assets/javascripts/miq_application.js
Expand Up @@ -293,7 +293,9 @@ function miqDimDiv(divname, status) {
// Check for changes and prompt
function miqCheckForChanges() {
if (ManageIQ.angular.scope) {
if (angular.isDefined(ManageIQ.angular.scope.angularForm) && ManageIQ.angular.scope.angularForm.$dirty) {
if (angular.isDefined(ManageIQ.angular.scope.angularForm) &&
ManageIQ.angular.scope.angularForm.$dirty &&
!miqDomElementExists('ignore_form_changes')) {
var answer = confirm(__("Abandon changes?"));
if (answer) {
ManageIQ.angular.scope.angularForm.$setPristine(true);
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/_tl_options.html.haml
Expand Up @@ -88,6 +88,7 @@
'ng-disabled' => 'reportModel.tl_categories.length === 0',
'class' => 'timeline-apply'}
= _("Apply")
= hidden_field_tag(:ignore_form_changes)
:javascript
ManageIQ.angular.app.value('recordId', '#{@record.id}');
Expand Down

0 comments on commit bb666e3

Please sign in to comment.