Skip to content

Commit

Permalink
check that drop exists
Browse files Browse the repository at this point in the history
  • Loading branch information
audionerd committed Oct 13, 2017
1 parent 09e82ba commit c747ef0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tether-drop",
"version": "1.4.2",
"version": "1.4.3",
"homepage": "https://github.com/HubSpot/drop",
"authors": [
"Adam Schwartz <[email protected]>",
Expand Down
8 changes: 7 additions & 1 deletion dist/js/drop.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! tether-drop 1.4.1 */
/*! tether-drop 1.4.3 */

(function(root, factory) {
if (typeof define === 'function' && define.amd) {
Expand Down Expand Up @@ -420,6 +420,12 @@ function createContext() {
return;
}

// via https://github.com/HubSpot/drop/pull/171
if (!this.drop) {
// The instance was destroyed
return;
}

if (!this.drop.parentNode) {
document.body.appendChild(this.drop);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/js/drop.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tether-drop",
"version": "1.4.2",
"version": "1.4.3",
"description": "Client-side library for creating dropdowns",
"authors": [
"Zack Bloom <[email protected]>",
Expand Down
6 changes: 6 additions & 0 deletions src/js/drop.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,12 @@ function createContext(options={}) {
return;
}

// via https://github.com/HubSpot/drop/pull/171
if (!this.drop) {
// The instance was destroyed
return;
}

if (!this.drop.parentNode) {
document.body.appendChild(this.drop);
}
Expand Down

0 comments on commit c747ef0

Please sign in to comment.