最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to use logout alert popup from Smart admin for other requests too? - Stack Overflow

programmeradmin3浏览0评论

I am working with the Smart Admin Theme, particularly the Ajax version. When I press the logout button on the top right hand side, it brings out a nice alert confirmation message.

I am trying to look about how to use this in other requests as well? For example if someone is going to delete an important resource, I would like them to see it. But I am not sure if the theme makers have given a way to trigger this.

I know that there are data-attributes associated with it like:

data-logout-msg="You can improve your security further after logging out by closing this opened browser"

But I am not sure how to use this on another link in my application. Any idea anyone? Is there an API method somewhere I can call?

I am working with the Smart Admin Theme, particularly the Ajax version. When I press the logout button on the top right hand side, it brings out a nice alert confirmation message.

I am trying to look about how to use this in other requests as well? For example if someone is going to delete an important resource, I would like them to see it. But I am not sure if the theme makers have given a way to trigger this.

I know that there are data-attributes associated with it like:

data-logout-msg="You can improve your security further after logging out by closing this opened browser"

But I am not sure how to use this on another link in my application. Any idea anyone? Is there an API method somewhere I can call?

Share Improve this question asked May 5, 2015 at 10:13 RohanRohan 13.8k23 gold badges87 silver badges159 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

$("#smart-mod-eg1").click(function(e) {
            $.SmartMessageBox({
                title : "Smart Alert!",
                content : "This is a confirmation box. Can be programmed for button callback",
                buttons : '[No][Yes]'
            }, function(ButtonPressed) {
                if (ButtonPressed === "Yes") {

                    $.smallBox({
                        title : "Callback function",
                        content : " You pressed Yes...",
                        color : "#659265",
                        iconSmall : "fa fa-check fa-2x fadeInRight animated",
                        timeout : 4000
                    });
                }
                if (ButtonPressed === "No") {
                    $.smallBox({
                        title : "Callback function",
                        content : " You pressed No...",
                        color : "#C46A69",
                        iconSmall : "fa fa-times fa-2x fadeInRight animated",
                        timeout : 4000
                    });
                }

            });
            e.preventDefault();
        })

发布评论

评论列表(0)

  1. 暂无评论