Skip to content

Commit fc71814

Browse files
committed
give the option method a setter capability
1 parent dac5194 commit fc71814

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tooltipster",
3-
"version": "3.2.3",
3+
"version": "3.2.4",
44
"main": ["js/jquery.tooltipster.min.js", "css/tooltipster.css"],
55
"dependencies": {
66
"jquery": ">=1.7"

js/jquery.tooltipster.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
3-
Tooltipster 3.2.3 | 2014-05-02
3+
Tooltipster 3.2.4 | 2014-05-14
44
A rockin' custom tooltip jQuery plugin
55
66
Developed by Caleb Jacob under the MIT license http://opensource.org/licenses/MIT
@@ -1096,11 +1096,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
10961096
return this.$tooltip ? this.$tooltip[0] : undefined;
10971097
},
10981098

1099-
// public methods but for internal use only
1100-
option: function(o) {
1101-
return this.options[o];
1099+
// public methods but for internal use only
1100+
// getter if val is ommitted, setter otherwise
1101+
option: function(o, val) {
1102+
if (typeof val == 'undefined') return this.options[o];
1103+
else {
1104+
this.options[o] = val;
1105+
return this;
1106+
}
11021107
},
1103-
status: function(o) {
1108+
status: function() {
11041109
return this.Status;
11051110
}
11061111
};
@@ -1161,8 +1166,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
11611166
// if the current element holds a tooltipster instance
11621167
if(self){
11631168

1164-
if (typeof self[args[0]] === 'function') {
1165-
var resp = self[args[0]](args[1]);
1169+
if (typeof self[args[0]] === 'function') {
1170+
// note : args[1] and args[2] may not be defined
1171+
var resp = self[args[0]](args[1], args[2]);
11661172
}
11671173
else {
11681174
throw new Error('Unknown method .tooltipster("' + args[0] + '")');

js/jquery.tooltipster.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tooltipster.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"keywords": [
66
"tooltip"
77
],
8-
"version": "3.2.3",
8+
"version": "3.2.4",
99
"author": {
1010
"name": "Caleb Jacob",
1111
"url": "http://calebjacob.com/"

0 commit comments

Comments
 (0)