Last active
December 11, 2015 19:09
-
-
Save anasnakawa/4646950 to your computer and use it in GitHub Desktop.
overriding bootstrap typeahead to perform in rtl pages
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
// overriding typeahead | |
!function ($, biStrap) { | |
"use strict" | |
// defining standard namespace to wrap original bootstrap | |
// methods that needs to be overridden | |
biStrap.typeahead.show = $.fn.typeahead.Constructor.prototype.show; | |
$.fn.typeahead.Constructor.prototype.show = function(){ | |
biStrap.typeahead.show.apply(this, arguments); | |
var pos = /*$.extend({}, */this.$element.offset()/*, { | |
height: this.$element[0].offsetHeight | |
})*/ | |
this.$menu.css({ | |
/*top: pos.top + pos.height | |
,*/ right: $(window).width() - pos.left - this.$element.outerWidth() | |
, left: 'auto' | |
}) | |
/*this.$menu.show()*/ | |
this.shown = true | |
return this | |
} | |
} ( window.jQuery, | |
$.fn.biStrap = $.fn.biStrap || {}, | |
$.fn.biStrap.typeahead = {} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment