Last active
March 23, 2016 20:39
-
-
Save zimkies/8360181 to your computer and use it in GitHub Desktop.
MonkeyPatch for Jquery hide() and show() to work with Bootstrap 3
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
# MonkeyPatch for Jquery hide() and show() to work with Bootstrap 3 | |
# | |
# Bootstrap 3 defines hidden and hide with the !important marker which | |
# prevents .show() and .hide() from working on elements that have been | |
# hidden using these classes. | |
# This patch modifies the hide and show to simply add and remove these | |
(($) -> | |
show = $.fn.show | |
$.fn.show = -> | |
@removeClass("hidden hide") | |
show.apply(this, arguments) | |
hide = $.fn.hide | |
$.fn.hide = -> | |
@addClass("hidden hide") | |
hide.apply(this, arguments) | |
)(jQuery) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment