Skip to content

Commit 6558bab

Browse files
committed
dist build
1 parent fa52e2c commit 6558bab

File tree

6 files changed

+55
-30
lines changed

6 files changed

+55
-30
lines changed

dist/js/plugins/tooltipster/SVG/tooltipster-SVG.js

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ $.tooltipster._plugin({
5757
var self = this;
5858

5959
//list of instance variables
60+
self.__hadTitleTag = false;
6061
self.__instance = instance;
6162

6263
// jQuery < v3.0's addClass and hasClass do not work on SVG elements.
@@ -76,10 +77,17 @@ $.tooltipster._plugin({
7677
// TODO: when there are several <title> tags (not supported in
7778
// today's browsers yet though, still an RFC draft), pick the right
7879
// one based on its "lang" attribute
79-
var $title = self.__instance._$origin.find('title');
80+
var $title = self.__instance._$origin.find('>title');
8081

8182
if ($title[0]) {
82-
self.__instance.content($title.text());
83+
84+
var title = $title.text();
85+
86+
self.__hadTitleTag = true;
87+
self.__instance._$origin.data('tooltipster-initialTitle', title);
88+
self.__instance.content(title);
89+
90+
$title.remove();
8391
}
8492
}
8593

@@ -115,18 +123,35 @@ $.tooltipster._plugin({
115123
})
116124
// if jQuery < v3.0, we have to remove the class ourselves
117125
._on('destroyed.'+ self.namespace, function() {
118-
self.destroy();
126+
self.__destroy();
119127
});
120128
},
121129

122130
__destroy: function() {
123131

124-
if (!self.__instance._$origin.hasClass('tooltipstered')) {
125-
var c = self.__instance._$origin.attr('class').replace('tooltipstered', '');
126-
self.__instance._$origin.attr('class', c);
132+
if (!this.__instance._$origin.hasClass('tooltipstered')) {
133+
var c = this.__instance._$origin.attr('class').replace('tooltipstered', '');
134+
this.__instance._$origin.attr('class', c);
127135
}
128136

129-
self.__instance._off('.'+ self.namespace);
137+
this.__instance._off('.'+ this.namespace);
138+
139+
// if the content was provided as a title tag, we may need to restore it
140+
if (this.__hadTitleTag) {
141+
142+
// if a title attribute was restored, we just need to replace it with a tag
143+
var title = this.__instance._$origin.attr('title');
144+
145+
if (title) {
146+
147+
// must be namespaced to work
148+
$(document.createElementNS('http://www.w3.org/2000/svg', 'title'))
149+
.text(title)
150+
.appendTo(this.__instance._$origin);
151+
152+
this.__instance._$origin.removeAttr('title');
153+
}
154+
}
130155
}
131156
}
132157
});

dist/js/plugins/tooltipster/SVG/tooltipster-SVG.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.

dist/js/tooltipster.bundle.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ var defaults = {
8686
hasTransitions: transitionSupport(),
8787
IE: false,
8888
// don't set manually, it will be updated by a build task after the manifest
89-
semVer: '4.0.1',
89+
semVer: '4.0.2',
9090
window: win
9191
},
9292
core = function() {
@@ -2468,13 +2468,6 @@ $.Tooltipster.prototype = {
24682468
self.__destroying = false;
24692469
self.__destroyed = true;
24702470

2471-
// last event
2472-
self._trigger('destroyed');
2473-
2474-
// unbind private and public event listeners
2475-
self._off();
2476-
self.off();
2477-
24782471
self._$origin
24792472
.removeData(self.__namespace)
24802473
// remove the open trigger listeners
@@ -2528,13 +2521,20 @@ $.Tooltipster.prototype = {
25282521
}
25292522
}
25302523

2524+
// last event
2525+
self._trigger('destroyed');
2526+
2527+
// unbind private and public event listeners
2528+
self._off();
2529+
self.off();
2530+
25312531
// remove external references, just in case
25322532
self.__Content = null;
2533-
self._$origin = null;
25342533
self.__$emitterPrivate = null;
25352534
self.__$emitterPublic = null;
2536-
self._$tooltip = null;
25372535
self.__options.parent = null;
2536+
self._$origin = null;
2537+
self._$tooltip = null;
25382538

25392539
// make sure the object is no longer referenced in there to prevent
25402540
// memory leaks

dist/js/tooltipster.bundle.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.

dist/js/tooltipster.core.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ var defaults = {
8686
hasTransitions: transitionSupport(),
8787
IE: false,
8888
// don't set manually, it will be updated by a build task after the manifest
89-
semVer: '4.0.1',
89+
semVer: '4.0.2',
9090
window: win
9191
},
9292
core = function() {
@@ -2468,13 +2468,6 @@ $.Tooltipster.prototype = {
24682468
self.__destroying = false;
24692469
self.__destroyed = true;
24702470

2471-
// last event
2472-
self._trigger('destroyed');
2473-
2474-
// unbind private and public event listeners
2475-
self._off();
2476-
self.off();
2477-
24782471
self._$origin
24792472
.removeData(self.__namespace)
24802473
// remove the open trigger listeners
@@ -2528,13 +2521,20 @@ $.Tooltipster.prototype = {
25282521
}
25292522
}
25302523

2524+
// last event
2525+
self._trigger('destroyed');
2526+
2527+
// unbind private and public event listeners
2528+
self._off();
2529+
self.off();
2530+
25312531
// remove external references, just in case
25322532
self.__Content = null;
2533-
self._$origin = null;
25342533
self.__$emitterPrivate = null;
25352534
self.__$emitterPublic = null;
2536-
self._$tooltip = null;
25372535
self.__options.parent = null;
2536+
self._$origin = null;
2537+
self._$tooltip = null;
25382538

25392539
// make sure the object is no longer referenced in there to prevent
25402540
// memory leaks

dist/js/tooltipster.core.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.

0 commit comments

Comments
 (0)