From 2e20ccbdbddbb8043a6838ca79de38765dac12cc Mon Sep 17 00:00:00 2001 From: Jos van den Oever Date: Fri, 11 Oct 2013 10:13:07 +0200 Subject: [PATCH] Avoid undesired selections. --- webodf/lib/xmled/XmlEditor.js | 3 +++ webodf/opxml.css | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/webodf/lib/xmled/XmlEditor.js b/webodf/lib/xmled/XmlEditor.js index 7984f5de..e141e53d 100644 --- a/webodf/lib/xmled/XmlEditor.js +++ b/webodf/lib/xmled/XmlEditor.js @@ -262,6 +262,7 @@ xmled.XmlEditor = function XmlEditor(element, grammarurl, styleurl) { crumbElement.style.paddingBottom = "0.1em"; crumbElement.style.backgroundColor = '#000000'; crumbElement.style.whiteSpace = 'normal'; + crumbElement.className = 'unselectable'; canvasElement.style.marginTop = "0.3em"; canvasElement.style.display = "inline-block"; canvasElement.style.width = "40em"; @@ -288,6 +289,8 @@ xmled.XmlEditor = function XmlEditor(element, grammarurl, styleurl) { attributeEditorElement.style.whiteSpace = 'normal'; attributeEditorElement.style.fontFamily = 'sans'; attributeEditorElement.style.fontSize = 'smaller'; + attributeEditorElement.className = 'unselectable'; + viewButtons.className = 'unselectable'; canvas = new xmled.XmlCanvas(canvasElement, validationModel, styleurl); var root = canvas.getDocumentRoot(); crumbBar = new xmled.CrumbBar(crumbElement, root, validationModel); diff --git a/webodf/opxml.css b/webodf/opxml.css index d8e75e34..f4341372 100644 --- a/webodf/opxml.css +++ b/webodf/opxml.css @@ -73,3 +73,14 @@ .hoveropaque:hover { background-color: rgba(128,128,128,0.5); } +.unselectable { + -moz-user-select: none; + -khtml-user-select: none; + -webkit-user-select: none; + /* + * Introduced in IE 10. + * See http://ie.microsoft.com/testdrive/HTML5/msUserSelect/ + * */ + -ms-user-select: none; + user-select: none; +}