Skip to content

Commit

Permalink
Added debug option
Browse files Browse the repository at this point in the history
  • Loading branch information
louisameline committed Jun 28, 2014
1 parent 0ca94a6 commit d54e160
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ autoClose
content
contentAsHTML
contentCloning
debug
delay
minWidth
maxWidth
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tooltipster",
"version": "3.2.4",
"version": "3.2.5",
"main": ["js/jquery.tooltipster.min.js", "css/tooltipster.css"],
"dependencies": {
"jquery": ">=1.7"
Expand Down
8 changes: 6 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,11 @@ <h2>Options</h2>
<td>boolean</td>
<td>If you provide a jQuery object to the 'content' option, this sets if it is a clone of this object that should actually be used. <strong>Default: true</strong></td>
</tr>
<tr>
<td><h4>debug</h4></td>
<td>boolean</td>
<td>Tooltipster logs notices into the console when you're doing something you ideally shouldn't be doing. Set to false to disable logging. <strong>Default: true</strong></td>
</tr>
<tr>
<td><h4>delay</h4></td>
<td>integer</td>
Expand Down Expand Up @@ -702,5 +707,4 @@ <h3>Share thoughts, questions, &amp; bugs!</h3>
})();
</script>
</body>
</html>

</html>
17 changes: 10 additions & 7 deletions js/jquery.tooltipster.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Tooltipster 3.2.4 | 2014-05-14
Tooltipster 3.2.5 | 2014-06-28
A rockin' custom tooltip jQuery plugin
Developed by Caleb Jacob under the MIT license http://opensource.org/licenses/MIT
Expand All @@ -20,6 +20,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
content: null,
contentAsHTML: false,
contentCloning: true,
debug: true,
delay: 200,
minWidth: 0,
maxWidth: null,
Expand Down Expand Up @@ -1164,7 +1165,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
self = ns ? $(this).data(ns[0]) : null;

// if the current element holds a tooltipster instance
if(self){
if (self) {

if (typeof self[args[0]] === 'function') {
// note : args[1] and args[2] may not be defined
Expand Down Expand Up @@ -1207,12 +1208,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (!ns) {
go = true;
}
else {
if(multiple) go = true;
else console.log('Tooltipster: one or more tooltips are already attached to this element: ignoring. Use the "multiple" option to attach more tooltips.');
else if (multiple) {
go = true;
}
else if (self.options.debug) {
console.log('Tooltipster: one or more tooltips are already attached to this element: ignoring. Use the "multiple" option to attach more tooltips.');
}

if(go) {
if (go) {
instance = new Plugin(this, args[0]);

// save the reference of the new instance
Expand All @@ -1227,7 +1230,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
instances.push(instance);
});

if(multiple) return instances;
if (multiple) return instances;
else return this;
}
}
Expand Down
2 changes: 1 addition & 1 deletion js/jquery.tooltipster.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tooltipster.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"keywords": [
"tooltip"
],
"version": "3.2.4",
"version": "3.2.5",
"author": {
"name": "Caleb Jacob",
"url": "http://calebjacob.com/"
Expand Down

0 comments on commit d54e160

Please sign in to comment.