Move non-canvas supported fallback to seperate file

This commit is contained in:
Niklas von Hertzen
2014-03-15 13:22:55 +02:00
parent 81c22866bc
commit b35fcaeaf9
5 changed files with 53 additions and 26 deletions

View File

@ -1,12 +1,5 @@
var html2canvasNodeAttribute = "data-html2canvas-node";
if (typeof(Object.create) !== "function" || typeof(document.createElement("canvas").getContext) !== "function") {
window.html2canvas = function() {
return Promise.reject("No canvas support");
};
return;
}
window.html2canvas = function(nodeList, options) {
options = options || {};
if (options.logging) {

6
src/fallback.js Normal file
View File

@ -0,0 +1,6 @@
if (typeof(Object.create) !== "function" || typeof(document.createElement("canvas").getContext) !== "function") {
window.html2canvas = function() {
return Promise.reject("No canvas support");
};
return;
}