diff --git a/app/views/console/account/index.phtml b/app/views/console/account/index.phtml index f35d1b7689..88b96cbe3c 100644 --- a/app/views/console/account/index.phtml +++ b/app/views/console/account/index.phtml @@ -74,7 +74,7 @@ data-event="submit" data-success="trigger,alert" data-success-param-alert-text="Email address updated successfully" - data-success-param-trigger-events="account-update" + data-success-param-trigger-events="account-update,modal-close" data-failure="alert" data-failure-param-alert-text="Failed updating email address" data-failure-param-alert-classname="error"> diff --git a/app/views/home/auth/signin.phtml b/app/views/home/auth/signin.phtml index 0fa4396cca..d516caeae7 100644 --- a/app/views/home/auth/signin.phtml +++ b/app/views/home/auth/signin.phtml @@ -23,7 +23,7 @@ data-service="account.createSession" data-scope="console" data-event="submit" - data-success="trigger,redirect" + data-success="trigger,hide,redirect" data-success-param-trigger-events="account.createSession" data-success-param-redirect-url="/console" data-failure="alert" diff --git a/app/views/home/auth/signup.phtml b/app/views/home/auth/signup.phtml index a79b447b6b..7f51de26d7 100644 --- a/app/views/home/auth/signup.phtml +++ b/app/views/home/auth/signup.phtml @@ -14,7 +14,7 @@ data-service="account.create" data-scope="console" data-event="submit" - data-success="trigger" + data-success="trigger,hide" data-success-param-trigger-events="account.create" data-success-param-redirect-url="/console" data-failure="alert" diff --git a/public/dist/scripts/app-all.js b/public/dist/scripts/app-all.js index 522ee688aa..6a441c7258 100644 --- a/public/dist/scripts/app-all.js +++ b/public/dist/scripts/app-all.js @@ -2584,7 +2584,7 @@ window.getSelection().removeAllRanges();});element.parentNode.parentNode.appendC let config={type:"line",data:{labels:[],datasets:[{label:"Requests",backgroundColor:"rgba(230, 248, 253, 0.3)",borderColor:"#29b5d9",borderWidth:2,data:[0,0,0,0,0,0,0],fill:true}]},options:{responsive:true,title:{display:false,text:"Stats"},legend:{display:false},tooltips:{mode:"index",intersect:false,caretPadding:0},hover:{mode:"nearest",intersect:true},scales:{xAxes:[{display:false}],yAxes:[{display:false}]}}};for(let i=0;ielement.trim()):[];failure=failure&&failure!=""?failure.split(",").map(element=>element.trim()):[];if(debug) -console.log("%c[service init]: "+action+" ("+service+")","color:red");let callbacks={hide:function(){return function(){return element.style.display='none';};},reset:function(){return function(){if("FORM"===element.tagName){return element.reset();} +console.log("%c[service init]: "+action+" ("+service+")","color:red");let callbacks={hide:function(){return function(){return element.style.opacity='0';};},reset:function(){return function(){if("FORM"===element.tagName){return element.reset();} throw new Error("This callback is only valid for forms");};},alert:function(text,classname){return function(alerts){alerts.add({text:text,class:classname||"success"},3000);};},redirect:function(url){return function(router){window.location=url||"/";};},reload:function(){return function(router){router.reload();};},state:function(keys){let updateQueryString=function(key,value,url){var re=new RegExp("([?&])"+key+"=.*?(&|#|$)(.*)","gi"),hash;if(re.test(url)){if(typeof value!=="undefined"&&value!==null){return url.replace(re,"$1"+key+"="+value+"$2$3");}else{hash=url.split("#");url=hash[0].replace(re,"$1$3").replace(/(&|\?)$/,"");if(typeof hash[1]!=="undefined"&&hash[1]!==null){url+="#"+hash[1];} return url;}}else{if(typeof value!=="undefined"&&value!==null){var separator=url.indexOf("?")!==-1?"&":"?";hash=url.split("#");url=hash[0]+separator+key+"="+value;if(typeof hash[1]!=="undefined"&&hash[1]!==null){url+="#"+hash[1];} return url;}else{return url;}}};keys=keys.split(",").map(element=>element.trim());return function(serviceForm,router,window){let url=window.location.href;keys.map(node=>{node=node.split("=");let key=node[0]||"";let name=node[1]||key;let value=getValue(key,"param",serviceForm);url=updateQueryString(name,value?value:null,url);});if(url!==window.location.href){window.history.pushState({},"",url);router.reset();}};},trigger:function(events){return function(document){events=events.trim().split(",");for(let i=0;ielement.trim()):[];failure=failure&&failure!=""?failure.split(",").map(element=>element.trim()):[];if(debug) -console.log("%c[service init]: "+action+" ("+service+")","color:red");let callbacks={hide:function(){return function(){return element.style.display='none';};},reset:function(){return function(){if("FORM"===element.tagName){return element.reset();} +console.log("%c[service init]: "+action+" ("+service+")","color:red");let callbacks={hide:function(){return function(){return element.style.opacity='0';};},reset:function(){return function(){if("FORM"===element.tagName){return element.reset();} throw new Error("This callback is only valid for forms");};},alert:function(text,classname){return function(alerts){alerts.add({text:text,class:classname||"success"},3000);};},redirect:function(url){return function(router){window.location=url||"/";};},reload:function(){return function(router){router.reload();};},state:function(keys){let updateQueryString=function(key,value,url){var re=new RegExp("([?&])"+key+"=.*?(&|#|$)(.*)","gi"),hash;if(re.test(url)){if(typeof value!=="undefined"&&value!==null){return url.replace(re,"$1"+key+"="+value+"$2$3");}else{hash=url.split("#");url=hash[0].replace(re,"$1$3").replace(/(&|\?)$/,"");if(typeof hash[1]!=="undefined"&&hash[1]!==null){url+="#"+hash[1];} return url;}}else{if(typeof value!=="undefined"&&value!==null){var separator=url.indexOf("?")!==-1?"&":"?";hash=url.split("#");url=hash[0]+separator+key+"="+value;if(typeof hash[1]!=="undefined"&&hash[1]!==null){url+="#"+hash[1];} return url;}else{return url;}}};keys=keys.split(",").map(element=>element.trim());return function(serviceForm,router,window){let url=window.location.href;keys.map(node=>{node=node.split("=");let key=node[0]||"";let name=node[1]||key;let value=getValue(key,"param",serviceForm);url=updateQueryString(name,value?value:null,url);});if(url!==window.location.href){window.history.pushState({},"",url);router.reset();}};},trigger:function(events){return function(document){events=events.trim().split(",");for(let i=0;i