Permalink
Browse files

add default hint position + remove unused functions

  • Loading branch information...
1 parent b1e5ef2 commit 2a3798778a9e4c8c4e6d793ab1ff11feb6c19927 @afshinm afshinm committed Dec 21, 2015
Showing with 3 additions and 47 deletions.
  1. +0 −4 example/programmatic/hint.html
  2. +3 −43 intro.js
@@ -99,10 +99,6 @@ <h1 id='step1'>Hints</h1>
console.log('hint clicked', hintElement, item, stepId);
});
- intro.onhintremove(function (stepId) {
- console.log('hint removed', stepId);
- });
-
intro.onhintclose(function (stepId) {
console.log('hint closed', stepId);
});
View
@@ -68,7 +68,7 @@
/* Disable an interaction with element? */
disableInteraction: false,
/* Default hint position */
- hintPosition: 'top',
+ hintPosition: 'top-middle',
/* Hint button label */
hintButtonLabel: 'Got it'
};
@@ -1218,6 +1218,8 @@
currentItem.element = document.querySelector(currentItem.element);
}
+ currentItem.hintPosition = currentItem.hintPosition || 'top-middle';
+
if (currentItem.element != null) {
this._introItems.push(currentItem);
}
@@ -1270,26 +1272,6 @@
}
/**
- * Remove single hint from the page
- *
- * @api private
- * @method _removeHint
- */
- function _removeHint(stepId) {
- _removeHintTooltip.call(this);
- var hint = this._targetElement.querySelector('.introjs-hint[data-step="' + stepId + '"]');
-
- if (hint) {
- hint.parentNode.removeChild(hint);
- }
-
- // call the callback function (if any)
- if (typeof (this._hintRemoveCallback) !== 'undefined') {
- this._hintRemoveCallback.call(this, stepId);
- }
- };
-
- /**
* Hide a hint
*
* @api private
@@ -1310,20 +1292,6 @@
};
/**
- * Remove all hints from the page
- *
- * @api private
- * @method _removeHints
- */
- function _removeHints() {
- var hints = this._targetElement.querySelectorAll('.introjs-hint');
-
- for (var i = 0, l = hints.length; i < l; i++) {
- _removeHint.call(this, hints[i].getAttribute('data-step'));
- }
- };
-
- /**
* Add all available hints to the page
*
* @api private
@@ -1698,14 +1666,6 @@
}
return this;
},
- onhintremove: function(providedCallback) {
- if (typeof (providedCallback) === 'function') {
- this._hintRemoveCallback = providedCallback;
- } else {
- throw new Error('Provided callback for onhintremove was not a function.');
- }
- return this;
- },
onexit: function(providedCallback) {
if (typeof (providedCallback) === 'function') {
this._introExitCallback = providedCallback;

0 comments on commit 2a37987

Please sign in to comment.