From eae7c86da57bf2c2591e75c5fd04dbbaf422d8c0 Mon Sep 17 00:00:00 2001 From: Luis Leiva Date: Mon, 22 Jul 2019 16:39:42 +0300 Subject: [PATCH] Fixed select bug --- src/jquery.sketchable.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/jquery.sketchable.js b/src/jquery.sketchable.js index a70723a..4cddd8a 100644 --- a/src/jquery.sketchable.js +++ b/src/jquery.sketchable.js @@ -411,12 +411,14 @@ */ function postProcess(elem, options) { if (!options) options = elem.data(namespace).options; + + var domEl = elem.get(0); if (options.cssCursors) { // Visually indicate whether this element is interactive or not. - elem[0].style.cursor = options.interactive ? 'pointer' : 'not-allowed'; + domEl.style.cursor = options.interactive ? 'pointer' : 'not-allowed'; } - // Fix unwanted highlight "bug". Note: `this` is the actual DOM element. - this.onselectstart = function() { + // Fix unwanted highlight "bug". + domEl.onselectstart = function() { return false; }; };