-
-
Save nagarjun/230ab547f3a50801f2ee to your computer and use it in GitHub Desktop.
Destroy any jQuery click handlers that have been set before transitioning to a different route.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in the component's didInsertElement | |
$(window).on('resize', function() { | |
return Em.run.debounce(that, 'resizeWindow', 250); | |
}); | |
// in the route's willTransition | |
actions: { | |
willTransition: function() { | |
$(window).off('resize'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment