Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Add support for title.button without title.text
  • Loading branch information
Craga89 committed Nov 15, 2012
1 parent 30ed702 commit 263aa53
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 62 deletions.
32 changes: 19 additions & 13 deletions dist/basic/jquery.qtip.css
@@ -1,4 +1,4 @@
/*! qTip2 - Pretty powerful tooltips - v2.0.0 - 2012-11-14
/*! qTip2 - Pretty powerful tooltips - v2.0.0 - 2012-11-15
* http://craigsworks.com/projects/qtip2/
* Copyright (c) 2012 Craig Michael Thompson; Licensed MIT, GPL */

Expand Down Expand Up @@ -31,6 +31,8 @@

font-size: 10.5px;
line-height: 12px;

direction: ltr;
}

.ui-tooltip-content{
Expand All @@ -54,27 +56,31 @@

.ui-tooltip-titlebar + .ui-tooltip-content{ border-top-width: 0 !important; }

/* Default close button class */
.ui-tooltip-titlebar .ui-state-default{
position: absolute;
right: 4px;
top: 50%;
margin-top: -9px;
/* Default close button class */
.ui-tooltip-close{
position: absolute;
right: -9px; top: -9px;

cursor: pointer;
outline: medium none;

cursor: pointer;
outline: medium none;
border-width: 1px;
border-style: solid;
}

border-width: 1px;
border-style: solid;
.ui-tooltip-titlebar .ui-tooltip-close{
right: 4px; top: 50%;
margin-top: -9px;
}
* html .ui-tooltip-titlebar .ui-state-default{ top: 16px; } /* IE fix */

* html .ui-tooltip-titlebar .ui-tooltip-close{ top: 16px; } /* IE fix */

.ui-tooltip-titlebar .ui-icon,
.ui-tooltip-icon .ui-icon{
display: block;
text-indent: -1000em;
direction: ltr;
vertical-align: middle;
}

.ui-tooltip-icon, .ui-tooltip-icon .ui-icon{
Expand Down
13 changes: 6 additions & 7 deletions dist/basic/jquery.qtip.js
@@ -1,4 +1,4 @@
/*! qTip2 - Pretty powerful tooltips - v2.0.0 - 2012-11-14
/*! qTip2 - Pretty powerful tooltips - v2.0.0 - 2012-11-15
* http://craigsworks.com/projects/qtip2/
* Copyright (c) 2012 Craig Michael Thompson; Licensed MIT, GPL */

Expand Down Expand Up @@ -218,7 +218,7 @@ function QTip(target, options, id, attr)
}

// Create button and setup attributes
elements.button.appendTo(elements.titlebar)
elements.button.appendTo(elements.titlebar || tooltip)
.attr('role', 'button')
.click(function(event) {
if(!tooltip.hasClass(disabled)) { self.hide(event); }
Expand Down Expand Up @@ -260,8 +260,7 @@ function QTip(target, options, id, attr)

function updateButton(button)
{
var elem = elements.button,
title = elements.title;
var elem = elements.button;

// Make sure tooltip is rendered and if not, return
if(!self.rendered) { return FALSE; }
Expand All @@ -270,9 +269,6 @@ function QTip(target, options, id, attr)
elem.remove();
}
else {
if(!title) {
createTitle();
}
createButton();
}
}
Expand Down Expand Up @@ -774,6 +770,9 @@ function QTip(target, options, id, attr)
if(!$.isFunction(title)) { updateTitle(title, FALSE); }
}

// Create button
else { createButton(); }

// Set proper rendered flag and update content if not a callback function (called in toggle)
if(!$.isFunction(text)) { updateContent(text, FALSE); }
self.rendered = TRUE;
Expand Down
2 changes: 1 addition & 1 deletion dist/basic/jquery.qtip.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/basic/jquery.qtip.min.js

Large diffs are not rendered by default.

32 changes: 19 additions & 13 deletions dist/jquery.qtip.css
@@ -1,4 +1,4 @@
/*! qTip2 - Pretty powerful tooltips - v2.0.0 - 2012-11-14
/*! qTip2 - Pretty powerful tooltips - v2.0.0 - 2012-11-15
* http://craigsworks.com/projects/qtip2/
* Copyright (c) 2012 Craig Michael Thompson; Licensed MIT, GPL */

Expand Down Expand Up @@ -31,6 +31,8 @@

font-size: 10.5px;
line-height: 12px;

direction: ltr;
}

.ui-tooltip-content{
Expand All @@ -54,27 +56,31 @@

.ui-tooltip-titlebar + .ui-tooltip-content{ border-top-width: 0 !important; }

/* Default close button class */
.ui-tooltip-titlebar .ui-state-default{
position: absolute;
right: 4px;
top: 50%;
margin-top: -9px;
/* Default close button class */
.ui-tooltip-close{
position: absolute;
right: -9px; top: -9px;

cursor: pointer;
outline: medium none;
cursor: pointer;
outline: medium none;

border-width: 1px;
border-style: solid;
border-width: 1px;
border-style: solid;
}

.ui-tooltip-titlebar .ui-tooltip-close{
right: 4px; top: 50%;
margin-top: -9px;
}
* html .ui-tooltip-titlebar .ui-state-default{ top: 16px; } /* IE fix */

* html .ui-tooltip-titlebar .ui-tooltip-close{ top: 16px; } /* IE fix */

.ui-tooltip-titlebar .ui-icon,
.ui-tooltip-icon .ui-icon{
display: block;
text-indent: -1000em;
direction: ltr;
vertical-align: middle;
}

.ui-tooltip-icon, .ui-tooltip-icon .ui-icon{
Expand Down
13 changes: 6 additions & 7 deletions dist/jquery.qtip.js
@@ -1,4 +1,4 @@
/*! qTip2 - Pretty powerful tooltips - v2.0.0 - 2012-11-14
/*! qTip2 - Pretty powerful tooltips - v2.0.0 - 2012-11-15
* http://craigsworks.com/projects/qtip2/
* Copyright (c) 2012 Craig Michael Thompson; Licensed MIT, GPL */

Expand Down Expand Up @@ -218,7 +218,7 @@ function QTip(target, options, id, attr)
}

// Create button and setup attributes
elements.button.appendTo(elements.titlebar)
elements.button.appendTo(elements.titlebar || tooltip)
.attr('role', 'button')
.click(function(event) {
if(!tooltip.hasClass(disabled)) { self.hide(event); }
Expand Down Expand Up @@ -260,8 +260,7 @@ function QTip(target, options, id, attr)

function updateButton(button)
{
var elem = elements.button,
title = elements.title;
var elem = elements.button;

// Make sure tooltip is rendered and if not, return
if(!self.rendered) { return FALSE; }
Expand All @@ -270,9 +269,6 @@ function QTip(target, options, id, attr)
elem.remove();
}
else {
if(!title) {
createTitle();
}
createButton();
}
}
Expand Down Expand Up @@ -774,6 +770,9 @@ function QTip(target, options, id, attr)
if(!$.isFunction(title)) { updateTitle(title, FALSE); }
}

// Create button
else { createButton(); }

// Set proper rendered flag and update content if not a callback function (called in toggle)
if(!$.isFunction(text)) { updateContent(text, FALSE); }
self.rendered = TRUE;
Expand Down

2 comments on commit 263aa53

@zinkkrysty
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This creates button for every tooltip, by default. Is it necessary? How do we disable it?

@Craga89
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #428

Please sign in to comment.