From d8a8f6adf72b112c1d2f28b88cf4ec2524b78c95 Mon Sep 17 00:00:00 2001 From: Menaka Jayawardena Date: Tue, 29 Aug 2017 15:13:39 +0530 Subject: [PATCH] Restructured the setTimeout function. --- .../cdmf.unit.policy.create/public/js/policy-create.js | 6 ++++-- .../cdmf.unit.role.edit.permission/public/js/bottomJs.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/js/policy-create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/js/policy-create.js index a4d03689b64..de24dbca766 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/js/policy-create.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/js/policy-create.js @@ -428,8 +428,10 @@ var savePolicy = function (policy, isActive, serviceURL) { $(".add-policy").addClass("hidden"); $(".policy-naming").addClass("hidden"); $(".policy-message").removeClass("hidden"); - setTimeout(function(){}, 1000); - window.location.href = "/devicemgt/policies"; + setTimeout(function(){ + window.location.href = "/devicemgt/policies"; + }, 1000); + }, function (data) { } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit.permission/public/js/bottomJs.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit.permission/public/js/bottomJs.js index 0775eec6a15..6d5c42e72d9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit.permission/public/js/bottomJs.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit.permission/public/js/bottomJs.js @@ -184,8 +184,10 @@ $(document).ready(function () { // Refreshing with success message $("#role-create-form").addClass("hidden"); $("#role-created-msg").removeClass("hidden"); - setTimeout(function(){}, 1000); - window.location.href = "/devicemgt/roles"; + setTimeout(function(){ + window.location.href = "/devicemgt/roles"; + }, 1000); + } }, function (data) { var payload = JSON.parse(data.responseText);