This is a migrated thread and some comments may be shown as answers.

kendoWindow custom action button click triggers browser window popstate handler

0 Answers 91 Views
Window
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 04 Sep 2012, 02:21 PM
Hello,

Can anyone confirm the kendoWindow custom action, as shown below, triggers the browser window's popstate event handler?

 $("#window").kendoWindow({
      actions
: ["Custom", "Minimize", "Maximize", "Close"],
      title
: "Window Title"
 
}).data("kendoWindow").wrapper.find(".k-custom").click(function(e) {
      alert
("Custom action button clicked");
      e
.preventDefault();
 
});

It does in my case.  Here's the relevant popstate code:

    
function popStateHandler(e) {
 
    var State = e.state;
 
    if (State != null) {
 
        console.log(State);
 
        switch (State.stateTitle) {
 
            case "Landing Page":
 
                console.log('transitioning to landing page ...');
 
                // show the content div and hide the hide the login panel
                //
                Transitions.PrimaryElementTransitions.HideLoginPanel();
 
                break;
 
            default:
 
                break;
 
        } // end switch ...
 
    } else if (window.processingLogin == true) {
        console.log('Processing login flag is true.');
 
        window.ProcessingLogin = false;
    } else {
        console.log('transitioning to login state ...');
 
        // show the login panel and hide the content div
        //
        Transitions.PrimaryElementTransitions.ShowLoginPanel();
    }
}
 
// Attach the window.history popstate event handler defined above.
//
window.addEventListener("popstate", popStateHandler, false); // end function definition and addEventListener method invocation ...

Thanks,

Dan

No answers yet. Maybe you can help?

Tags
Window
Asked by
Daniel
Top achievements
Rank 1
Share this question
or