Skip to content

Commit

Permalink
fixed fixedWidth padding bug
Browse files Browse the repository at this point in the history
  • Loading branch information
calebjacob committed Sep 15, 2012
1 parent 0350b12 commit f3e9a59
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions index.html
Expand Up @@ -8,13 +8,14 @@
<link rel="stylesheet" type="text/css" href="css/tooltipster.css" />

<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.tooltipster.min.js"></script>
<script type="text/javascript" src="js/jquery.tooltipster.js"></script>

<script type="text/javascript">

$(document).ready(function() {
$('.tooltip').tooltipster({
position: 'top'
position: 'top',
fixedWidth: 300
});
});

Expand Down
12 changes: 7 additions & 5 deletions js/jquery.tooltipster.js
Expand Up @@ -101,11 +101,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
var offset = $(this).offset();

// Hardcoding the width and removing the padding fixed an issue with the tooltip width collapsing when the window size is small
$(settings.tooltipTheme).not('.tooltip-kill').css({
'width': tooltip_width + 'px',
'padding-left': '0px',
'padding-right': '0px'
});
if(settings.fixedWidth == 0) {
$(settings.tooltipTheme).not('.tooltip-kill').css({
'width': tooltip_width + 'px',
'padding-left': '0px',
'padding-right': '0px'
});
}


// A function to detect if the tooltip is going off the screen. If so, reposition the crap out of it!
Expand Down

0 comments on commit f3e9a59

Please sign in to comment.