Skip to content

Commit

Permalink
wording
Browse files Browse the repository at this point in the history
  • Loading branch information
louisameline committed Feb 12, 2017
1 parent ea443af commit d2e4cdd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/js/tooltipster.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var defaults = {
IEmin: 6,
interactive: false,
multiple: false,
// must be 'body' for now (default), or an element positioned at (0, 0)
// will default to document.body, or must be an element positioned at (0, 0)
// in the document, typically like the very top views of an app.
parent: null,
plugins: ['sideTip'],
Expand Down Expand Up @@ -1966,15 +1966,17 @@ $.Tooltipster.prototype = {

if (self.__state != 'closed') {

var eventNames = '';
var eventNames = '',
$body = $(env.window.document.body);

if (self.__options.triggerClose.click) {
eventNames += 'click.'+ self.__namespace +'-triggerClose ';
}
if (self.__options.triggerClose.tap && env.hasTouchCapability) {
eventNames += 'touchend.'+ self.__namespace +'-triggerClose';
}

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

if (self._touchIsMeaningfulEvent(event)) {

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

$(env.window.document.body).on('touchstart.'+ self.__namespace +'-triggerClose', function(event) {
$body.on('touchstart.'+ self.__namespace +'-triggerClose', function(event) {
self._touchRecordEvent(event);
});
}
Expand Down

0 comments on commit d2e4cdd

Please sign in to comment.