From b8323ce896a851bbe5a18e17bff36a5bdaa97db1 Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Mon, 24 Jan 2011 14:45:31 -0700 Subject: [PATCH] Trying to make unselectable --- controller.js | 15 ++++++++------- controller.number.js | 1 + gui.css | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/controller.js b/controller.js index e51803b..d88e86e 100644 --- a/controller.js +++ b/controller.js @@ -12,6 +12,13 @@ var Controller = function() { return this.object[this.propertyName]; } + this.makeUnselectable = function(elem) { + elem.onselectstart = function() { return false; }; + elem.style.MozUserSelect = "none"; + elem.style.KhtmlUserSelect = "none"; + elem.unselectable = "on"; + } + this.domElement = document.createElement('div'); this.domElement.setAttribute('class', 'guidat-controller ' + this.type); @@ -23,12 +30,6 @@ var Controller = function() { this.setName(this.propertyName); this.domElement.appendChild(this.propertyNameElement); - makeUnselectable(this.domElement); + this.makeUnselectable(this.domElement); - function makeUnselectable(elem) { - elem.onselectstart = function() { return false; }; - elem.style.MozUserSelect = "none"; - elem.style.KhtmlUserSelect = "none"; - elem.unselectable = "on"; - } }; \ No newline at end of file diff --git a/controller.number.js b/controller.number.js index ec32947..dfee720 100644 --- a/controller.number.js +++ b/controller.number.js @@ -65,6 +65,7 @@ var NumberController = function() { button.value = inc; _this.setValue(inc); } + return false; }, false); this.__defineSetter__("position", function(val) { diff --git a/gui.css b/gui.css index 95dd873..036d9ed 100644 --- a/gui.css +++ b/gui.css @@ -78,6 +78,7 @@ } .guidat-controller.number input[type=number] { width: 45px; + cursor: ns-resize; } .guidat-controller.boolean input {