/*!
* jQuery Pretty Dropdowns Plugin v2.0.0 by T. H. Doan (http://thdoan.github.io/pretty-dropdowns/)
*
* jQuery Pretty Dropdowns by T. H. Doan is licensed under the MIT License.
* Read a copy of the license in the LICENSE file or at
* http://choosealicense.com/licenses/mit
*/
(function($) {
$.fn.prettyDropdown = function(oOptions) {
// Default options
oOptions = $.extend({
customClass: 'arrow',
height: 48,
hoverIntent: 100
}, oOptions);
var nTimer,
resetDropdown = function(o) {
var $dropdown = $(o.currentTarget||o);
$dropdown.data('hover', false);
clearTimeout(nTimer);
nTimer = setTimeout(function() {
if (!$dropdown.data('hover')) {
if ($dropdown.hasClass('reverse')) $dropdown.prepend($('li:last-child', $dropdown));
$dropdown.removeClass('active reverse').css('height', '');
}
}, (o.type==='mouseleave') ? oOptions.hoverIntent : 0);
};
// Validate options
if (isNaN(oOptions.height) || oOptions.height<8) oOptions.height = 8;
if (isNaN(oOptions.hoverIntent) || oOptions.hoverIntent<0) oOptions.hoverIntent = 200;
return this.each(function() {
var $this = $(this);
if ($this.data('loaded')) return true; // Continue
$this.outerHeight(oOptions.height);
// NOTE: $this.css('margin') returns empty string in Firefox.
// See https://github.com/jquery/jquery/issues/3383
var nWidth = $this.outerWidth(),
sHtml = '