Skip to content

Commit

Permalink
dist build
Browse files Browse the repository at this point in the history
  • Loading branch information
louisameline committed Jun 22, 2016
1 parent b99547f commit c37bdae
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 20 deletions.
21 changes: 12 additions & 9 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.2',
semVer: '4.0.4',
window: win
},
core = function() {
Expand Down Expand Up @@ -679,7 +679,7 @@ $.Tooltipster.prototype = {
$document = $(env.window.document),
$window = $(env.window),
$parent = $target,
// some useful properties of important elements
// some useful properties of important elements
geo = {
// available space for the tooltip, see down below
available: {
Expand Down Expand Up @@ -1346,7 +1346,7 @@ $.Tooltipster.prototype = {
// if the origin or tooltip elements have been removed.
// Note: we could destroy the instance now if the origin has
// been removed but we'll leave that task to our garbage collector
if (!bodyContains(self._$origin) || !bodyContains(self.__namespace)) {
if (!bodyContains(self._$origin) || !bodyContains(self._$tooltip)) {
self._close();
}
// if everything is alright
Expand Down Expand Up @@ -2773,7 +2773,7 @@ $.Tooltipster.prototype = {

// if the tooltip has not been removed from DOM manually (or if it
// has been detached on purpose)
if (bodyContains(self.__namespace) || tooltipIsDetached) {
if (bodyContains(self._$tooltip) || tooltipIsDetached) {

if (!tooltipIsDetached) {
// detach in case the tooltip overflows the window and adds
Expand Down Expand Up @@ -3236,14 +3236,17 @@ function areEqual(a,b) {
/**
* A fast function to check if an element is still in the DOM. It
* tries to use an id as ids are indexed by the browser, or falls
* back to jQuery's `contains` method.
* back to jQuery's `contains` method. May fail if two elements
* have the same id, but so be it
*
* @param {string|object} ref An id or a jQuery-wrapped HTML element
* @param {object} $obj A jQuery-wrapped HTML element
* @return {boolean}
*/
function bodyContains(ref) {
var id = (typeof ref === 'string') ? ref : ref.attr('id');
return id ? !!env.window.document.getElementById(id) : $.contains(env.window.document.body, ref[0]);
function bodyContains($obj) {
var id = $obj.attr('id'),
el = id ? env.window.document.getElementById(id) : null;
// must also check that the element with the id is the one we want
return el ? el === $obj[0] : $.contains(env.window.document.body, $obj[0]);
}

// detect IE versions for dirty fixes
Expand Down
2 changes: 1 addition & 1 deletion 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 @@ -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.2',
semVer: '4.0.4',
window: win
},
core = function() {
Expand Down Expand Up @@ -679,7 +679,7 @@ $.Tooltipster.prototype = {
$document = $(env.window.document),
$window = $(env.window),
$parent = $target,
// some useful properties of important elements
// some useful properties of important elements
geo = {
// available space for the tooltip, see down below
available: {
Expand Down Expand Up @@ -1346,7 +1346,7 @@ $.Tooltipster.prototype = {
// if the origin or tooltip elements have been removed.
// Note: we could destroy the instance now if the origin has
// been removed but we'll leave that task to our garbage collector
if (!bodyContains(self._$origin) || !bodyContains(self.__namespace)) {
if (!bodyContains(self._$origin) || !bodyContains(self._$tooltip)) {
self._close();
}
// if everything is alright
Expand Down Expand Up @@ -2773,7 +2773,7 @@ $.Tooltipster.prototype = {

// if the tooltip has not been removed from DOM manually (or if it
// has been detached on purpose)
if (bodyContains(self.__namespace) || tooltipIsDetached) {
if (bodyContains(self._$tooltip) || tooltipIsDetached) {

if (!tooltipIsDetached) {
// detach in case the tooltip overflows the window and adds
Expand Down Expand Up @@ -3236,14 +3236,17 @@ function areEqual(a,b) {
/**
* A fast function to check if an element is still in the DOM. It
* tries to use an id as ids are indexed by the browser, or falls
* back to jQuery's `contains` method.
* back to jQuery's `contains` method. May fail if two elements
* have the same id, but so be it
*
* @param {string|object} ref An id or a jQuery-wrapped HTML element
* @param {object} $obj A jQuery-wrapped HTML element
* @return {boolean}
*/
function bodyContains(ref) {
var id = (typeof ref === 'string') ? ref : ref.attr('id');
return id ? !!env.window.document.getElementById(id) : $.contains(env.window.document.body, ref[0]);
function bodyContains($obj) {
var id = $obj.attr('id'),
el = id ? env.window.document.getElementById(id) : null;
// must also check that the element with the id is the one we want
return el ? el === $obj[0] : $.contains(env.window.document.body, $obj[0]);
}

// detect IE versions for dirty fixes
Expand Down
Loading

0 comments on commit c37bdae

Please sign in to comment.