mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 20:51:21 -03: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:
parent
9965ec01be
commit
8c234dc915
@ -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,
|
||||
ncyBreadcrumb: {
|
||||
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: {
|
||||
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'),
|
||||
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: {
|
||||
parent: "jobTemplates",
|
||||
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: {
|
||||
parent: 'jobTemplates',
|
||||
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: {
|
||||
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) {
|
||||
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'),
|
||||
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();
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user