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
/* like jquery-ui scrollParent function except it works on jQuery objects containing multiple elements */ | |
(function ($) { | |
$.fn.scrollParent = (function (overflowRegex) { | |
return function () { | |
return $($.unique(this.map(function () { | |
var position = $(this).css('position'), | |
excludeStaticParent = position === 'absolute', | |
scrollParent = $(this).parents().filter(function() { | |
var parent = $(this); | |
if (excludeStaticParent && parent.css('position') === 'static') { |
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
/* jquery shim to focus on any element regardless of tabindex */ | |
(function($) { | |
$.fn.focus = (function(focus) { | |
return function () { | |
if (arguments.length > 0) { | |
return focus.apply(this, arguments); | |
} | |
if (typeof $(this).attr('tabindex') === 'undefined') { | |
return focus.call(this.attr('tabindex', '-1')).removeAttr('tabindex'); | |
} |
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
/* jquery shims for [add|remove|has]Class for svg */ | |
(function ($) { | |
$.fn.addClass = (function(addClass) { | |
return function(value) { | |
return addClass.apply(this, arguments).each(function () { | |
if (this instanceof SVGElement) { | |
$(this).attr('class', $('<div/>', {'class': $(this).attr('class')}).addClass(value).attr('class')); | |
} |