Created
February 14, 2018 16:32
-
-
Save diego-mi/89de4f759b9564643fba7029f8fcdb20 to your computer and use it in GitHub Desktop.
sobrescrever o evento de addClass para disparar um evento 'cssClassChanged'
This file contains hidden or 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
| // Create a event trigger after change class of element | |
| (function () { | |
| var originalAddClassMethod = jQuery.fn.addClass; | |
| jQuery.fn.addClass = function () { | |
| var result = originalAddClassMethod.apply(this, arguments); | |
| jQuery(this).trigger('cssClassChanged'); | |
| return result; | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment