Skip to content

Global event unbinding breaks other plugins #63

Closed
@ValentinH

Description

@ValentinH

In this line (and some other), event listener is unbind in this way:

$document.off('mousemove');

The problem is that it removes all the listener on the page and so, it can break other plugins using this event.

The good practice is to namespace your event like this:

$document.on('mousemove.rzslider', angular.bind(this, this.onMove, pointer));

//and later
$document.off('mousemove.rzslider');

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