Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for custom tooltip classes #1164

Merged
merged 1 commit into from Nov 16, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,5 +1,5 @@
/* /*
* jQuery Foundation Tooltips 2.0.1 * jQuery Foundation Tooltips 2.0.2
* http://foundation.zurb.com * http://foundation.zurb.com
* Copyright 2012, ZURB * Copyright 2012, ZURB
* Free to use under the MIT license. * Free to use under the MIT license.
Expand All @@ -14,6 +14,7 @@
var settings = { var settings = {
bodyHeight : 0, bodyHeight : 0,
selector : '.has-tip', selector : '.has-tip',
additionalInheritableClasses : [],
tooltipClass : '.tooltip', tooltipClass : '.tooltip',
tipTemplate : function (selector, content) { tipTemplate : function (selector, content) {
return '<span data-selector="' + selector + '" class="' + settings.tooltipClass.substring(1) + '">' + content + '<span class="nub"></span></span>'; return '<span data-selector="' + selector + '" class="' + settings.tooltipClass.substring(1) + '">' + content + '<span class="nub"></span></span>';
Expand Down Expand Up @@ -144,7 +145,7 @@
tip.css('visibility', 'visible').hide(); tip.css('visibility', 'visible').hide();
}, },
inheritable_classes : function (target) { inheritable_classes : function (target) {
var inheritables = ['tip-top', 'tip-left', 'tip-bottom', 'tip-right', 'noradius'], var inheritables = ['tip-top', 'tip-left', 'tip-bottom', 'tip-right', 'noradius'].concat(settings.additionalInheritableClasses),
classes = target.attr('class'), classes = target.attr('class'),
filtered = classes ? $.map(classes.split(' '), function (el, i) { filtered = classes ? $.map(classes.split(' '), function (el, i) {
if ($.inArray(el, inheritables) !== -1) { if ($.inArray(el, inheritables) !== -1) {
Expand Down