mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
Added onExit functions to routes where the job launch and survey maker modals may be displayed. This will handle cleaning up the modal properly so that it can be re-opened
This commit is contained in:
@@ -255,6 +255,16 @@ var tower = angular.module('Tower', [
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}]
|
}]
|
||||||
|
},
|
||||||
|
onExit: function(){
|
||||||
|
// close the job launch modal
|
||||||
|
// using an onExit event to handle cases where the user navs away using the url bar / back and not modal "X"
|
||||||
|
// Destroy the dialog
|
||||||
|
if($("#job-launch-modal").hasClass('ui-dialog-content')) {
|
||||||
|
$('#job-launch-modal').dialog('destroy');
|
||||||
|
}
|
||||||
|
// Remove the directive from the page (if it's there)
|
||||||
|
$('#content-container').find('submit-job').remove();
|
||||||
}
|
}
|
||||||
}).
|
}).
|
||||||
|
|
||||||
@@ -264,6 +274,16 @@ var tower = angular.module('Tower', [
|
|||||||
controller: JobsListController,
|
controller: JobsListController,
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
label: "JOBS"
|
label: "JOBS"
|
||||||
|
},
|
||||||
|
onExit: function(){
|
||||||
|
// close the job launch modal
|
||||||
|
// using an onExit event to handle cases where the user navs away using the url bar / back and not modal "X"
|
||||||
|
// Destroy the dialog
|
||||||
|
if($("#job-launch-modal").hasClass('ui-dialog-content')) {
|
||||||
|
$('#job-launch-modal').dialog('destroy');
|
||||||
|
}
|
||||||
|
// Remove the directive from the page (if it's there)
|
||||||
|
$('#content-container').find('submit-job').remove();
|
||||||
}
|
}
|
||||||
}).
|
}).
|
||||||
|
|
||||||
|
|||||||
@@ -17,5 +17,15 @@ export default {
|
|||||||
},
|
},
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
skip: true // Never display this state in breadcrumb.
|
skip: true // Never display this state in breadcrumb.
|
||||||
|
},
|
||||||
|
onExit: function(){
|
||||||
|
// close the job launch modal
|
||||||
|
// using an onExit event to handle cases where the user navs away using the url bar / back and not modal "X"
|
||||||
|
// Destroy the dialog
|
||||||
|
if($("#job-launch-modal").hasClass('ui-dialog-content')) {
|
||||||
|
$('#job-launch-modal').dialog('destroy');
|
||||||
|
}
|
||||||
|
// Remove the directive from the page (if it's there)
|
||||||
|
$('#content-container').find('submit-job').remove();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -30,5 +30,15 @@ export default {
|
|||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
templateUrl: templateUrl('job-detail/job-detail'),
|
templateUrl: templateUrl('job-detail/job-detail'),
|
||||||
controller: 'JobDetailController'
|
controller: 'JobDetailController',
|
||||||
|
onExit: function(){
|
||||||
|
// close the job launch modal
|
||||||
|
// using an onExit event to handle cases where the user navs away using the url bar / back and not modal "X"
|
||||||
|
// Destroy the dialog
|
||||||
|
if($("#job-launch-modal").hasClass('ui-dialog-content')) {
|
||||||
|
$('#job-launch-modal').dialog('destroy');
|
||||||
|
}
|
||||||
|
// Remove the directive from the page (if it's there)
|
||||||
|
$('#content-container').find('submit-job').remove();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,5 +14,19 @@ export default {
|
|||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
parent: "jobTemplates",
|
parent: "jobTemplates",
|
||||||
label: "CREATE JOB TEMPLATE"
|
label: "CREATE JOB TEMPLATE"
|
||||||
|
},
|
||||||
|
onExit: function(){
|
||||||
|
// close the job launch modal
|
||||||
|
// using an onExit event to handle cases where the user navs away using the url bar / back and not modal "X"
|
||||||
|
// Destroy the dialog
|
||||||
|
if($("#job-launch-modal").hasClass('ui-dialog-content')) {
|
||||||
|
$('#job-launch-modal').dialog('destroy');
|
||||||
|
}
|
||||||
|
// Remove the directive from the page (if it's there)
|
||||||
|
$('#content-container').find('submit-job').remove();
|
||||||
|
|
||||||
|
if($("#survey-modal-dialog").hasClass('ui-dialog-content')) {
|
||||||
|
$('#survey-modal-dialog').dialog('destroy');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,5 +17,19 @@ export default {
|
|||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
parent: 'jobTemplates',
|
parent: 'jobTemplates',
|
||||||
label: "{{name}}"
|
label: "{{name}}"
|
||||||
|
},
|
||||||
|
onExit: function(){
|
||||||
|
// close the job launch modal
|
||||||
|
// using an onExit event to handle cases where the user navs away using the url bar / back and not modal "X"
|
||||||
|
// Destroy the dialog
|
||||||
|
if($("#job-launch-modal").hasClass('ui-dialog-content')) {
|
||||||
|
$('#job-launch-modal').dialog('destroy');
|
||||||
|
}
|
||||||
|
// Remove the directive from the page (if it's there)
|
||||||
|
$('#content-container').find('submit-job').remove();
|
||||||
|
|
||||||
|
if($("#survey-modal-dialog").hasClass('ui-dialog-content')) {
|
||||||
|
$('#survey-modal-dialog').dialog('destroy');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,5 +17,15 @@ export default {
|
|||||||
},
|
},
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
label: "JOB TEMPLATES"
|
label: "JOB TEMPLATES"
|
||||||
|
},
|
||||||
|
onExit: function(){
|
||||||
|
// close the job launch modal
|
||||||
|
// using an onExit event to handle cases where the user navs away using the url bar / back and not modal "X"
|
||||||
|
// Destroy the dialog
|
||||||
|
if($("#job-launch-modal").hasClass('ui-dialog-content')) {
|
||||||
|
$('#job-launch-modal').dialog('destroy');
|
||||||
|
}
|
||||||
|
// Remove the directive from the page (if it's there)
|
||||||
|
$('#content-container').find('submit-job').remove();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -121,6 +121,16 @@ export default [
|
|||||||
features: ['FeaturesService', function(FeaturesService) {
|
features: ['FeaturesService', function(FeaturesService) {
|
||||||
return FeaturesService.get();
|
return FeaturesService.get();
|
||||||
}]
|
}]
|
||||||
|
},
|
||||||
|
onExit: function(){
|
||||||
|
// close the job launch modal
|
||||||
|
// using an onExit event to handle cases where the user navs away using the url bar / back and not modal "X"
|
||||||
|
// Destroy the dialog
|
||||||
|
if($("#job-launch-modal").hasClass('ui-dialog-content')) {
|
||||||
|
$('#job-launch-modal').dialog('destroy');
|
||||||
|
}
|
||||||
|
// Remove the directive from the page (if it's there)
|
||||||
|
$('#content-container').find('submit-job').remove();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,5 +24,15 @@ export default {
|
|||||||
templateUrl: templateUrl('portal-mode/portal-mode-jobs'),
|
templateUrl: templateUrl('portal-mode/portal-mode-jobs'),
|
||||||
controller: PortalModeJobsController
|
controller: PortalModeJobsController
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
onExit: function(){
|
||||||
|
// close the job launch modal
|
||||||
|
// using an onExit event to handle cases where the user navs away using the url bar / back and not modal "X"
|
||||||
|
// Destroy the dialog
|
||||||
|
if($("#job-launch-modal").hasClass('ui-dialog-content')) {
|
||||||
|
$('#job-launch-modal').dialog('destroy');
|
||||||
|
}
|
||||||
|
// Remove the directive from the page (if it's there)
|
||||||
|
$('#content-container').find('submit-job').remove();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user