From 5e19e57c2e0b63ab9394ba59c2d30ff14a70604f Mon Sep 17 00:00:00 2001 From: Edward Date: Fri, 7 Dec 2018 12:36:11 +0800 Subject: [PATCH] Pman.Dialog.BAdminStaffTwoFactorQRCode.bjs Pman.Dialog.BAdminStaffTwoFactorQRCode.js --- Pman.Dialog.BAdminStaffTwoFactorQRCode.bjs | 8 +++++--- Pman.Dialog.BAdminStaffTwoFactorQRCode.js | 17 ++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Pman.Dialog.BAdminStaffTwoFactorQRCode.bjs b/Pman.Dialog.BAdminStaffTwoFactorQRCode.bjs index 99f6a51a..8232c68c 100644 --- a/Pman.Dialog.BAdminStaffTwoFactorQRCode.bjs +++ b/Pman.Dialog.BAdminStaffTwoFactorQRCode.bjs @@ -19,9 +19,11 @@ "items" : [ { "listeners" : { - "show" : "function (_self)\n{\n if(!Pman.Login.authUser) {\n Roo.bootstrap.MessageBox.alert('Error', 'Please login again');\n return;\n }\n \n if(\n !_this.data.id ||\n _this.data.id.length == 0\n ) {\n Roo.bootstrap.MessageBox.alert('Error', 'Please select a person again');\n return;\n }\n \n _this.dialog.closeEl.hide();\n _this.cancelBtn.hide();\n \n if(_this.data.allow_close) {\n _this.dialog.closeEl.show();\n }\n \n if(_this.data.allow_cancel) {\n _this.cancelBtn.show();\n }\n \n new Pman.Request({\n url: baseURL + '/Roo/Core_person.php',\n method : 'GET',\n mask : 'Loading...',\n params : {\n _to_qr_code : 1,\n id: _this.data.id\n },\n \n success : function(res) {\n _this.qrcode_image.setSrc(res.data);\n },\n \n failure : function(res) {\n Roo.log(res);\n }\n });\n}" + "show" : "function (_self)\n{\n if(!Pman.Login.authUser) {\n Roo.bootstrap.MessageBox.alert('Error', 'Please login again');\n return;\n }\n \n if(\n !_this.data.id ||\n _this.data.id.length == 0\n ) {\n Roo.bootstrap.MessageBox.alert('Error', 'Please select a person again');\n return;\n }\n \n _this.dialog.closeEl.hide();\n _this.cancelBtn.hide();\n \n if(_this.data.allow_close) {\n _this.dialog.closeEl.show();\n }\n \n if(_this.data.allow_cancel) {\n _this.cancelBtn.show();\n }\n \n new Pman.Request({\n url: baseURL + '/Roo/Core_person.php',\n method : 'GET',\n mask : 'Loading...',\n params : {\n _to_qr_code : 1,\n id: _this.data.id\n },\n \n success : function(res) {\n _this.qrcode_image.setSrc(res.data);\n },\n \n failure : function(res) {\n Roo.log(res);\n }\n });\n}", + "hide" : "function (_self)\n{\n if(_this.callback){\n _this.callback.call(_this, false);\n }\n \n}" }, "String cls" : "enable-overflow coba-qr-dialog", + "Boolean animate" : false, "Boolean allow_close" : true, "xtype" : "Modal", "$ xns" : "Roo.bootstrap", @@ -30,7 +32,7 @@ { "listeners" : { "render" : "function (_self)\n{\n _this.cancelBtn = this;\n}", - "click" : "function (_self, e)\n{\n \n _this.dialog.hide();\n \n if(_this.callback){\n _this.callback.call(_this, false);\n }\n \n return;\n}" + "click" : "function (_self, e)\n{\n _this.dialog.hide();\n \n return;\n}" }, "String weight" : "default", "xtype" : "Button", @@ -122,7 +124,7 @@ { "listeners" : { "actionfailed" : "function (_self, action)\n{\n if(action.type == 'submit') {\n \n switch(action.result.errorMsg) {\n case '_invalid_auth_code':\n Roo.bootstrap.MessageBox.alert(\n 'Invalid authentication code',\n 'Please re-enter the latest authentication code.'\n );\n break;\n default:\n Roo.log('invalid usage');\n break;\n }\n }\n}", - "actioncomplete" : "function (_self, action)\n{\n if(action.type == 'setdata') {\n \n this.clearInvalid();\n }\n \n if(action.type == 'submit') {\n \n switch(action.result.data) {\n \n case 'DONE':\n var cb = function() {\n _this.dialog.hide();\n \n if(_this.callback){\n _this.callback.call(_this, true);\n }\n };\n \n Roo.bootstrap.MessageBox.alert('Success', 'Two Factor authentication has been enabled', cb);\n return;\n \n default:\n Roo.log('invalid usage');\n break;\n }\n }\n}", + "actioncomplete" : "function (_self, action)\n{\n if(action.type == 'setdata') {\n \n this.clearInvalid();\n }\n \n if(action.type == 'submit') {\n \n switch(action.result.data) {\n \n case 'DONE':\n var cb = function() {\n _this.dialog.hide();\n };\n \n Roo.bootstrap.MessageBox.alert('Success', 'Two Factor authentication has been enabled', cb);\n return;\n \n default:\n Roo.log('invalid usage');\n break;\n }\n }\n}", "render" : "function (_self)\n{\n _this.form = this;\n}" }, "xtype" : "Form", diff --git a/Pman.Dialog.BAdminStaffTwoFactorQRCode.js b/Pman.Dialog.BAdminStaffTwoFactorQRCode.js index 61c1c520..74e8d182 100644 --- a/Pman.Dialog.BAdminStaffTwoFactorQRCode.js +++ b/Pman.Dialog.BAdminStaffTwoFactorQRCode.js @@ -45,9 +45,17 @@ Roo.apply(Pman.Dialog.BAdminStaffTwoFactorQRCode.prototype, { this.dialog = Roo.factory({ xtype : 'Modal', allow_close : true, + animate : false, cls : 'enable-overflow coba-qr-dialog', title : _this._strings['4674ee874911c910f2356ef9ec6ab7f9'] /* Scan this into Google Authenticator */, listeners : { + hide : function (_self) + { + if(_this.callback){ + _this.callback.call(_this, false); + } + + }, show : function (_self) { if(!Pman.Login.authUser) { @@ -103,13 +111,8 @@ Roo.apply(Pman.Dialog.BAdminStaffTwoFactorQRCode.prototype, { listeners : { click : function (_self, e) { - _this.dialog.hide(); - if(_this.callback){ - _this.callback.call(_this, false); - } - return; }, render : function (_self) @@ -250,10 +253,6 @@ Roo.apply(Pman.Dialog.BAdminStaffTwoFactorQRCode.prototype, { case 'DONE': var cb = function() { _this.dialog.hide(); - - if(_this.callback){ - _this.callback.call(_this, true); - } }; Roo.bootstrap.MessageBox.alert('Success', 'Two Factor authentication has been enabled', cb); -- 2.39.2