From 55b3c9af5fb5431cd9ef338960f3a7308f2c9aae Mon Sep 17 00:00:00 2001 From: Tom Dodson Date: Tue, 13 Sep 2016 22:18:22 -0700 Subject: [PATCH] This is a more declarative way to check if the context is a jQuery element. Also no need to check .getContext twice. --- src/core/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/core.js b/src/core/core.js index 9000dbd223c..d5a843c9777 100755 --- a/src/core/core.js +++ b/src/core/core.js @@ -13,7 +13,7 @@ module.exports = function() { }; // Support a jQuery'd canvas element - if (context.length && context[0].getContext) { + if (typeof(jQuery) === 'function' && context instanceof jQuery) { context = context[0]; }