mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Move non-canvas supported fallback to seperate file
This commit is contained in:
parent
81c22866bc
commit
b35fcaeaf9
@ -21,7 +21,7 @@ module.exports = function(grunt) {
|
|||||||
concat: {
|
concat: {
|
||||||
dist: {
|
dist: {
|
||||||
src: [
|
src: [
|
||||||
'src/promise.js', 'src/**/*.js'
|
'src/promise.js', 'src/fallback.js', 'src/**/*.js'
|
||||||
],
|
],
|
||||||
dest: 'build/<%= pkg.name %>.js'
|
dest: 'build/<%= pkg.name %>.js'
|
||||||
},
|
},
|
||||||
|
File diff suppressed because one or more lines are too long
4
build/html2canvas.min.js
vendored
4
build/html2canvas.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,12 +1,5 @@
|
|||||||
var html2canvasNodeAttribute = "data-html2canvas-node";
|
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) {
|
window.html2canvas = function(nodeList, options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
if (options.logging) {
|
if (options.logging) {
|
||||||
|
6
src/fallback.js
Normal file
6
src/fallback.js
Normal 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;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user