|
68 | 68 | /* Disable an interaction with element? */
|
69 | 69 | disableInteraction: false,
|
70 | 70 | /* Default hint position */
|
71 |
| - hintPosition: 'top', |
| 71 | + hintPosition: 'top-middle', |
72 | 72 | /* Hint button label */
|
73 | 73 | hintButtonLabel: 'Got it'
|
74 | 74 | };
|
|
1218 | 1218 | currentItem.element = document.querySelector(currentItem.element);
|
1219 | 1219 | }
|
1220 | 1220 |
|
| 1221 | + currentItem.hintPosition = currentItem.hintPosition || 'top-middle'; |
| 1222 | + |
1221 | 1223 | if (currentItem.element != null) {
|
1222 | 1224 | this._introItems.push(currentItem);
|
1223 | 1225 | }
|
|
1269 | 1271 | }
|
1270 | 1272 | }
|
1271 | 1273 |
|
1272 |
| - /** |
1273 |
| - * Remove single hint from the page |
1274 |
| - * |
1275 |
| - * @api private |
1276 |
| - * @method _removeHint |
1277 |
| - */ |
1278 |
| - function _removeHint(stepId) { |
1279 |
| - _removeHintTooltip.call(this); |
1280 |
| - var hint = this._targetElement.querySelector('.introjs-hint[data-step="' + stepId + '"]'); |
1281 |
| - |
1282 |
| - if (hint) { |
1283 |
| - hint.parentNode.removeChild(hint); |
1284 |
| - } |
1285 |
| - |
1286 |
| - // call the callback function (if any) |
1287 |
| - if (typeof (this._hintRemoveCallback) !== 'undefined') { |
1288 |
| - this._hintRemoveCallback.call(this, stepId); |
1289 |
| - } |
1290 |
| - }; |
1291 |
| - |
1292 | 1274 | /**
|
1293 | 1275 | * Hide a hint
|
1294 | 1276 | *
|
|
1309 | 1291 | }
|
1310 | 1292 | };
|
1311 | 1293 |
|
1312 |
| - /** |
1313 |
| - * Remove all hints from the page |
1314 |
| - * |
1315 |
| - * @api private |
1316 |
| - * @method _removeHints |
1317 |
| - */ |
1318 |
| - function _removeHints() { |
1319 |
| - var hints = this._targetElement.querySelectorAll('.introjs-hint'); |
1320 |
| - |
1321 |
| - for (var i = 0, l = hints.length; i < l; i++) { |
1322 |
| - _removeHint.call(this, hints[i].getAttribute('data-step')); |
1323 |
| - } |
1324 |
| - }; |
1325 |
| - |
1326 | 1294 | /**
|
1327 | 1295 | * Add all available hints to the page
|
1328 | 1296 | *
|
|
1698 | 1666 | }
|
1699 | 1667 | return this;
|
1700 | 1668 | },
|
1701 |
| - onhintremove: function(providedCallback) { |
1702 |
| - if (typeof (providedCallback) === 'function') { |
1703 |
| - this._hintRemoveCallback = providedCallback; |
1704 |
| - } else { |
1705 |
| - throw new Error('Provided callback for onhintremove was not a function.'); |
1706 |
| - } |
1707 |
| - return this; |
1708 |
| - }, |
1709 | 1669 | onexit: function(providedCallback) {
|
1710 | 1670 | if (typeof (providedCallback) === 'function') {
|
1711 | 1671 | this._introExitCallback = providedCallback;
|
|
0 commit comments