Skip to content

Bug on winEvents for binding the event 'beforeunload' #7

@ghost

Description

When I use winEvents on a brite view,
When I bind the event beforeunload thanks the 'winEvents' of briteView, nothing appened.
With the same function binding directly, with 'on', it's work.

Below, an example of code :

beforeUnloadFn = function(e){
        var confirmationMessage = "\o/";
        (e || window.event).returnValue = confirmationMessage;     //Gecko + IE
        return confirmationMessage; 
      }
      brite.registerView('Test', {
        create: function(){
          return '<div style="background-color:red;height:50px;width:50px;"></div>'
        },
        winEvents: {
          //  No effect
          'beforeunload': beforeUnloadFn
        }
      });
      $(document).ready(function(){
        brite.display('Test', 'body');
        //  work
        //$(window).on("beforeunload", beforeUnloadFn);
      });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions