mirror of
https://github.com/konvajs/konva.git
synced 2025-12-19 19:56:59 +08:00
Added support for nw.js (node-webkit)
This commit is contained in:
@@ -369,10 +369,10 @@ var Konva = {};
|
|||||||
( function(root, factory) {
|
( function(root, factory) {
|
||||||
if( typeof exports === 'object') {
|
if( typeof exports === 'object') {
|
||||||
var KonvaJS = factory();
|
var KonvaJS = factory();
|
||||||
// runtime-check for browserify
|
// runtime-check for browserify and nw.js (node-webkit)
|
||||||
if(global.window === global) {
|
if(global.window && global.window.document) {
|
||||||
Konva.document = global.document;
|
Konva.document = global.window.document;
|
||||||
Konva.window = global;
|
Konva.window = global.window;
|
||||||
} else {
|
} else {
|
||||||
// Node. Does not work with strict CommonJS, but
|
// Node. Does not work with strict CommonJS, but
|
||||||
// only CommonJS-like enviroments that support module.exports,
|
// only CommonJS-like enviroments that support module.exports,
|
||||||
|
|||||||
Reference in New Issue
Block a user