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

Commit

Permalink
tips plugin nows saves canvas context on first create so FF2 doesn't …
Browse files Browse the repository at this point in the history
…bork on first restore() call
  • Loading branch information
Craga89 committed Dec 6, 2010
1 parent 544e395 commit d7c6526
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 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: Mon Dec 6 02:15:36 2010 +0000
* Date: Mon Dec 6 03:13:27 2010 +0000
*/

.ui-tooltip-accessible{
Expand Down
7 changes: 4 additions & 3 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: Mon Dec 6 02:15:36 2010 +0000
* Date: Mon Dec 6 03:13:27 2010 +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 @@ -1945,7 +1945,8 @@ function Tip(qTip, command)
switch(method)
{
case 'canvas':
elems.tip.append('<canvas height="'+height+'" width="'+width+'" />');
// save() as soon as we create the canvas element so FF2 doesn't bork on our first restore()!
$('<canvas height="'+height+'" width="'+width+'" />').appendTo(elems.tip)[0].getContext('2d').save();
break;

case 'vml':
Expand Down Expand Up @@ -2009,7 +2010,7 @@ function Tip(qTip, command)
case 'canvas':
// Grab canvas context and clear it
context = inner.get(0).getContext('2d');
context.restore();
if(context.restore) { context.restore(); }
context.clearRect(0,0,3000,3000);

// Grab tip coordinates
Expand Down
12 changes: 6 additions & 6 deletions dist/jquery.qtip.min.js

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

4 changes: 2 additions & 2 deletions dist/jquery.qtip.pack.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/tips.js
Expand Up @@ -254,7 +254,8 @@ function Tip(qTip, command)
switch(method)
{
case 'canvas':
elems.tip.append('<canvas height="'+height+'" width="'+width+'" />');
// save() as soon as we create the canvas element so FF2 doesn't bork on our first restore()!
$('<canvas height="'+height+'" width="'+width+'" />').appendTo(elems.tip)[0].getContext('2d').save();
break;

case 'vml':
Expand Down Expand Up @@ -318,7 +319,7 @@ function Tip(qTip, command)
case 'canvas':
// Grab canvas context and clear it
context = inner.get(0).getContext('2d');
context.restore();
if(context.restore) { context.restore(); }
context.clearRect(0,0,3000,3000);

// Grab tip coordinates
Expand Down

0 comments on commit d7c6526

Please sign in to comment.