-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove DOM calls on canvas only platforms
- Loading branch information
1 parent
6bcedbe
commit f572dc5
Showing
3 changed files
with
23 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
goog.provide('lime.dom'); | ||
goog.require('goog.dom'); | ||
|
||
lime.dom.isDOMSupported = function() { | ||
// This works for Ejecta. Probably not for others. Pull request! | ||
return !!document.head.parentNode; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
stringa
Contributor
|
||
} | ||
|
||
var old = goog.dom.getOwnerDocument; | ||
goog.dom.getOwnerDocument = function() { | ||
return old.apply(goog.dom, arguments) || document; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I was looking at the Ejecta source and they define window.ejecta as an object in the scene. Is it good to check for window.ejecta instead of your current check?
The following is in Ejecta.js
// The 'ej' object provides some basic info and utility functions
var ej = window.ejecta = new Ejecta.EjectaCore();