Skip to content

Commit

Permalink
dist build
Browse files Browse the repository at this point in the history
  • Loading branch information
louisameline committed Jun 17, 2016
1 parent fa52e2c commit 6558bab
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 30 deletions.
39 changes: 32 additions & 7 deletions dist/js/plugins/tooltipster/SVG/tooltipster-SVG.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ $.tooltipster._plugin({
var self = this;

//list of instance variables
self.__hadTitleTag = false;
self.__instance = instance;

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

if ($title[0]) {
self.__instance.content($title.text());

var title = $title.text();

self.__hadTitleTag = true;
self.__instance._$origin.data('tooltipster-initialTitle', title);
self.__instance.content(title);

$title.remove();
}
}

Expand Down Expand Up @@ -115,18 +123,35 @@ $.tooltipster._plugin({
})
// if jQuery < v3.0, we have to remove the class ourselves
._on('destroyed.'+ self.namespace, function() {
self.destroy();
self.__destroy();
});
},

__destroy: function() {

if (!self.__instance._$origin.hasClass('tooltipstered')) {
var c = self.__instance._$origin.attr('class').replace('tooltipstered', '');
self.__instance._$origin.attr('class', c);
if (!this.__instance._$origin.hasClass('tooltipstered')) {
var c = this.__instance._$origin.attr('class').replace('tooltipstered', '');
this.__instance._$origin.attr('class', c);
}

self.__instance._off('.'+ self.namespace);
this.__instance._off('.'+ this.namespace);

// if the content was provided as a title tag, we may need to restore it
if (this.__hadTitleTag) {

// if a title attribute was restored, we just need to replace it with a tag
var title = this.__instance._$origin.attr('title');

if (title) {

// must be namespaced to work
$(document.createElementNS('http://www.w3.org/2000/svg', 'title'))
.text(title)
.appendTo(this.__instance._$origin);

this.__instance._$origin.removeAttr('title');
}
}
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion dist/js/plugins/tooltipster/SVG/tooltipster-SVG.min.js

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

20 changes: 10 additions & 10 deletions dist/js/tooltipster.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ var defaults = {
hasTransitions: transitionSupport(),
IE: false,
// don't set manually, it will be updated by a build task after the manifest
semVer: '4.0.1',
semVer: '4.0.2',
window: win
},
core = function() {
Expand Down Expand Up @@ -2468,13 +2468,6 @@ $.Tooltipster.prototype = {
self.__destroying = false;
self.__destroyed = true;

// last event
self._trigger('destroyed');

// unbind private and public event listeners
self._off();
self.off();

self._$origin
.removeData(self.__namespace)
// remove the open trigger listeners
Expand Down Expand Up @@ -2528,13 +2521,20 @@ $.Tooltipster.prototype = {
}
}

// last event
self._trigger('destroyed');

// unbind private and public event listeners
self._off();
self.off();

// remove external references, just in case
self.__Content = null;
self._$origin = null;
self.__$emitterPrivate = null;
self.__$emitterPublic = null;
self._$tooltip = null;
self.__options.parent = null;
self._$origin = null;
self._$tooltip = null;

// make sure the object is no longer referenced in there to prevent
// memory leaks
Expand Down
2 changes: 1 addition & 1 deletion dist/js/tooltipster.bundle.min.js

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions dist/js/tooltipster.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ var defaults = {
hasTransitions: transitionSupport(),
IE: false,
// don't set manually, it will be updated by a build task after the manifest
semVer: '4.0.1',
semVer: '4.0.2',
window: win
},
core = function() {
Expand Down Expand Up @@ -2468,13 +2468,6 @@ $.Tooltipster.prototype = {
self.__destroying = false;
self.__destroyed = true;

// last event
self._trigger('destroyed');

// unbind private and public event listeners
self._off();
self.off();

self._$origin
.removeData(self.__namespace)
// remove the open trigger listeners
Expand Down Expand Up @@ -2528,13 +2521,20 @@ $.Tooltipster.prototype = {
}
}

// last event
self._trigger('destroyed');

// unbind private and public event listeners
self._off();
self.off();

// remove external references, just in case
self.__Content = null;
self._$origin = null;
self.__$emitterPrivate = null;
self.__$emitterPublic = null;
self._$tooltip = null;
self.__options.parent = null;
self._$origin = null;
self._$tooltip = null;

// make sure the object is no longer referenced in there to prevent
// memory leaks
Expand Down
2 changes: 1 addition & 1 deletion dist/js/tooltipster.core.min.js

Large diffs are not rendered by default.

0 comments on commit 6558bab

Please sign in to comment.