Only run the js for progress/plan edit on the right pages

Change-Id: I612982f1f2f13fae52b036a8ce61a76040eb2c5f
This commit is contained in:
Radomir Dopieralski 2014-10-06 15:20:42 +02:00
parent 7008d86283
commit fa856179ce
2 changed files with 2 additions and 4 deletions

View File

@ -4,7 +4,7 @@ tuskar.deployment_progress = (function () {
var module = {};
module.init = function () {
if (!$('div.deployment-box div.progress')) { return; }
if (!$('div.deployment-box div.progress').length) { return; }
module.interval = setInterval(module.check_progress, 30000);
module.events_template = Hogan.compile($('#events-template').html() || '');
module.roles_template = Hogan.compile($('#roles-template').html() || '');

View File

@ -6,10 +6,8 @@ tuskar.edit_plan = (function () {
module.debounce_timer = null;
module.init = function () {
if (!$('form.deployment-roles-form').length) { return; }
// Attach event listeners and hide the submit button.
if (!$('form.deployment-roles-form')) {
return;
}
$('form.deployment-roles-form input.number-picker'
).change(module.on_change);
$('form.deployment-roles-form [type=submit]').hide();