Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

check parentNode is not null - fixes #296 #361

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions dist/js/hopscotch.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
var HopscotchI18N;
var customI18N;
var customRenderer;
var customEscape;
var templateToUse = 'bubble_default';
var Sizzle = window.Sizzle || null;
var utils;
Expand Down Expand Up @@ -963,7 +962,7 @@
destroy: function destroy() {
var el = this.element;

if (el) {
if (el && el.parentNode) {
el.parentNode.removeChild(el);
}
utils.removeEvtListener(el, 'click', this.clickCb);
Expand Down Expand Up @@ -2400,9 +2399,6 @@
* @returns {Object} The Hopscotch object (for chaining).
*/
this.setEscaper = function (esc) {
if (typeof esc === 'function') {
customEscape = esc;
}
return this;
};

Expand Down
2 changes: 1 addition & 1 deletion dist/js/hopscotch.min.js

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions dist/js/hopscotch_amd.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define('hopscotch', function () { 'use strict';
define(function () { 'use strict';

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
return typeof obj;
Expand All @@ -30,7 +30,6 @@ define('hopscotch', function () { 'use strict';
var HopscotchI18N;
var customI18N;
var customRenderer;
var customEscape;
var templateToUse = 'bubble_default';
var Sizzle = window.Sizzle || null;
var utils;
Expand Down Expand Up @@ -959,7 +958,7 @@ define('hopscotch', function () { 'use strict';
destroy: function destroy() {
var el = this.element;

if (el) {
if (el && el.parentNode) {
el.parentNode.removeChild(el);
}
utils.removeEvtListener(el, 'click', this.clickCb);
Expand Down Expand Up @@ -2396,9 +2395,6 @@ define('hopscotch', function () { 'use strict';
* @returns {Object} The Hopscotch object (for chaining).
*/
this.setEscaper = function (esc) {
if (typeof esc === 'function') {
customEscape = esc;
}
return this;
};

Expand Down
2 changes: 1 addition & 1 deletion dist/js/hopscotch_amd.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-watch": "~0.5.1",
"grunt-include-replace": "~1.2.0",
"grunt-rollup": "^1.0.1",
"grunt-rollup": "~9.0.0",
"grunt-shell": "~0.3.1",
"grunt-template-jasmine-istanbul": "^0.3.0",
"grunt-template-jasmine-requirejs": "^0.2.3",
Expand Down
4 changes: 2 additions & 2 deletions src/js/hopscotch.js
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ HopscotchBubble.prototype = {
destroy: function() {
var el = this.element;

if (el) {
if (el && el.parentNode) {
el.parentNode.removeChild(el);
}
utils.removeEvtListener(el, 'click', this.clickCb);
Expand Down Expand Up @@ -2421,4 +2421,4 @@ winHopscotch = new Hopscotch();
// @@include('../../tmp/js/hopscotch_templates.js') //
}.call(winHopscotch));

export default winHopscotch;
export default winHopscotch;