diff --git a/tuskar_ui/infrastructure/static/infrastructure/js/tuskar.deployment_progress.js b/tuskar_ui/infrastructure/static/infrastructure/js/tuskar.deployment_progress.js index 2c308c146..2b21442e9 100644 --- a/tuskar_ui/infrastructure/static/infrastructure/js/tuskar.deployment_progress.js +++ b/tuskar_ui/infrastructure/static/infrastructure/js/tuskar.deployment_progress.js @@ -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() || ''); diff --git a/tuskar_ui/infrastructure/static/infrastructure/js/tuskar.edit_plan.js b/tuskar_ui/infrastructure/static/infrastructure/js/tuskar.edit_plan.js index 69fddda88..89f9f568b 100644 --- a/tuskar_ui/infrastructure/static/infrastructure/js/tuskar.edit_plan.js +++ b/tuskar_ui/infrastructure/static/infrastructure/js/tuskar.edit_plan.js @@ -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();