mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Fail with a Promise.reject when no canvas support
This commit is contained in:
parent
3101f2007a
commit
12d85e3c04
@ -21,7 +21,7 @@ module.exports = function(grunt) {
|
||||
concat: {
|
||||
dist: {
|
||||
src: [
|
||||
'src/**/*.js'
|
||||
'src/promise.js', 'src/**/*.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,5 +1,12 @@
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user