Skip to content
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

/.idea
.DS_Store
8 changes: 5 additions & 3 deletions js/heartcode-canvasloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
* Initialization method
* @method init
* @protected
* @param id {String} The id of the placeholder div, where the loader will be nested into
* @param pId {String|HTMLElement} Either an html node element or the id of the placeholder div, where the loader will be nested into
* @param opt {Object} Optional parameters<br/><br/>
* <strong>Possible values of optional parameters:</strong><br/>
* <ul>
Expand All @@ -128,8 +128,10 @@
* If the container element cannot be found we use the document body itself
*/
try {
// Look for the parent element
if (document.getElementById(pId) !== undefined) {
if (pId instanceof window.Element){
this.mum = pId;
} else if (document.getElementById(pId) !== undefined) {
// Look for the parent element
this.mum = document.getElementById(pId);
} else {
this.mum = document.body;
Expand Down