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

Commit

Permalink
Updated sanitizations for title.text
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Jan 13, 2011
1 parent 7f215df commit 2e93928
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 78 deletions.
2 changes: 1 addition & 1 deletion dist/jquery.qtip.css
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Thu Jan 13 09:18:01 2011 +0000
* Date: Thu Jan 13 10:09:14 2011 +0000
*/

/* Fluid class for determining actual width in IE */
Expand Down
21 changes: 14 additions & 7 deletions dist/jquery.qtip.js
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Thu Jan 13 09:18:01 2011 +0000
* Date: Thu Jan 13 10:09:14 2011 +0000
*/

"use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
Expand Down Expand Up @@ -55,13 +55,20 @@ function sanitizeOptions(opts)

content = opts.content.text || FALSE;
if(!$.isFunction(content) && ((!content && !content.attr) || content.length < 1 || ('object' === typeof content && !content.jquery))) {
content = opts.content.text = FALSE;
opts.content.text = FALSE;
}

if('title' in opts.content && 'object' !== typeof opts.content.title) {
opts.content.title = {
text: opts.content.title
};
if('title' in opts.content) {
if('object' !== typeof opts.content.title) {
opts.content.title = {
text: opts.content.title
};
}

content = opts.content.title.text || FALSE;
if(!$.isFunction(content) && ((!content && !content.attr) || content.length < 1 || ('object' === typeof content && !content.jquery))) {
opts.content.text = FALSE;
}
}
}

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

function isVisible() {
return tooltip.css('left') !== hideOffset;
return tooltip[0].offsetLeft !== hideOffset;
}

function setWidget() {
Expand Down

0 comments on commit 2e93928

Please sign in to comment.