Skip to content

Commit

Permalink
dist build
Browse files Browse the repository at this point in the history
  • Loading branch information
louisameline committed Feb 12, 2017
1 parent 0d0127a commit ea443af
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 21 deletions.
21 changes: 12 additions & 9 deletions dist/js/tooltipster.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ var defaults = {
IEmin: 6,
interactive: false,
multiple: false,
// must be 'body' for now, or an element positioned at (0, 0)
// must be 'body' for now (default), or an element positioned at (0, 0)
// in the document, typically like the very top views of an app.
parent: 'body',
parent: null,
plugins: ['sideTip'],
repositionOnScroll: false,
restoration: 'none',
Expand Down Expand Up @@ -568,7 +568,7 @@ $.Tooltipster.prototype = {

// to detect swiping
if (env.hasTouchCapability) {
$('body').on('touchmove.'+ self.__namespace +'-triggerOpen', function(event) {
$(env.window.document.body).on('touchmove.'+ self.__namespace +'-triggerOpen', function(event) {
self._touchRecordEvent(event);
});
}
Expand Down Expand Up @@ -963,7 +963,10 @@ $.Tooltipster.prototype = {
}

// determine the future parent
if (typeof this.__options.parent == 'string') {
if (this.__options.parent === null) {
this.__options.parent = $(env.window.document.body);
}
else if (typeof this.__options.parent == 'string') {
this.__options.parent = $(this.__options.parent);
}

Expand Down Expand Up @@ -1541,7 +1544,7 @@ $.Tooltipster.prototype = {
// clear the array to prevent memory leaks
self.__$originParents = null;

$('body').off('.'+ self.__namespace +'-triggerClose');
$(env.window.document.body).off('.'+ self.__namespace +'-triggerClose');

self._$origin.off('.'+ self.__namespace +'-triggerClose');

Expand Down Expand Up @@ -1993,7 +1996,7 @@ $.Tooltipster.prototype = {
eventNames += 'touchend.'+ self.__namespace +'-triggerClose';
}

$('body').on(eventNames, function(event) {
$(env.window.document.body).on(eventNames, function(event) {

if (self._touchIsMeaningfulEvent(event)) {

Expand All @@ -2008,7 +2011,7 @@ $.Tooltipster.prototype = {
// needed to detect and ignore swiping
if (self.__options.triggerClose.tap && env.hasTouchCapability) {

$('body').on('touchstart.'+ self.__namespace +'-triggerClose', function(event) {
$(env.window.document.body).on('touchstart.'+ self.__namespace +'-triggerClose', function(event) {
self._touchRecordEvent(event);
});
}
Expand Down Expand Up @@ -2507,7 +2510,7 @@ $.Tooltipster.prototype = {
.off('.'+ self.__namespace +'-triggerOpen');

// remove the touch listener
$('body').off('.' + self.__namespace +'-triggerOpen');
$(env.window.document.body).off('.' + self.__namespace +'-triggerOpen');

var ns = self._$origin.data('tooltipster-ns');

Expand Down Expand Up @@ -3092,7 +3095,7 @@ Ruler.prototype = {

this.$container = $('<div class="tooltipster-ruler"></div>')
.append(this.__$tooltip)
.appendTo('body');
.appendTo(env.window.document.body);
},

/**
Expand Down
4 changes: 2 additions & 2 deletions dist/js/tooltipster.bundle.min.js

Large diffs are not rendered by default.

21 changes: 12 additions & 9 deletions dist/js/tooltipster.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ var defaults = {
IEmin: 6,
interactive: false,
multiple: false,
// must be 'body' for now, or an element positioned at (0, 0)
// must be 'body' for now (default), or an element positioned at (0, 0)
// in the document, typically like the very top views of an app.
parent: 'body',
parent: null,
plugins: ['sideTip'],
repositionOnScroll: false,
restoration: 'none',
Expand Down Expand Up @@ -568,7 +568,7 @@ $.Tooltipster.prototype = {

// to detect swiping
if (env.hasTouchCapability) {
$('body').on('touchmove.'+ self.__namespace +'-triggerOpen', function(event) {
$(env.window.document.body).on('touchmove.'+ self.__namespace +'-triggerOpen', function(event) {
self._touchRecordEvent(event);
});
}
Expand Down Expand Up @@ -963,7 +963,10 @@ $.Tooltipster.prototype = {
}

// determine the future parent
if (typeof this.__options.parent == 'string') {
if (this.__options.parent === null) {
this.__options.parent = $(env.window.document.body);
}
else if (typeof this.__options.parent == 'string') {
this.__options.parent = $(this.__options.parent);
}

Expand Down Expand Up @@ -1541,7 +1544,7 @@ $.Tooltipster.prototype = {
// clear the array to prevent memory leaks
self.__$originParents = null;

$('body').off('.'+ self.__namespace +'-triggerClose');
$(env.window.document.body).off('.'+ self.__namespace +'-triggerClose');

self._$origin.off('.'+ self.__namespace +'-triggerClose');

Expand Down Expand Up @@ -1993,7 +1996,7 @@ $.Tooltipster.prototype = {
eventNames += 'touchend.'+ self.__namespace +'-triggerClose';
}

$('body').on(eventNames, function(event) {
$(env.window.document.body).on(eventNames, function(event) {

if (self._touchIsMeaningfulEvent(event)) {

Expand All @@ -2008,7 +2011,7 @@ $.Tooltipster.prototype = {
// needed to detect and ignore swiping
if (self.__options.triggerClose.tap && env.hasTouchCapability) {

$('body').on('touchstart.'+ self.__namespace +'-triggerClose', function(event) {
$(env.window.document.body).on('touchstart.'+ self.__namespace +'-triggerClose', function(event) {
self._touchRecordEvent(event);
});
}
Expand Down Expand Up @@ -2507,7 +2510,7 @@ $.Tooltipster.prototype = {
.off('.'+ self.__namespace +'-triggerOpen');

// remove the touch listener
$('body').off('.' + self.__namespace +'-triggerOpen');
$(env.window.document.body).off('.' + self.__namespace +'-triggerOpen');

var ns = self._$origin.data('tooltipster-ns');

Expand Down Expand Up @@ -3092,7 +3095,7 @@ Ruler.prototype = {

this.$container = $('<div class="tooltipster-ruler"></div>')
.append(this.__$tooltip)
.appendTo('body');
.appendTo(env.window.document.body);
},

/**
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 ea443af

Please sign in to comment.