summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-03-04 19:06:33 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-03-04 19:06:33 +0000
commite8bc0b298007fad76fbcaa26bd91faea1ef23c9e (patch)
tree4cf3fac3cfd56ef12271e337221189659e556295 /public
parentbd5fe10c13b0fb15825f767f696e57bb709c1f68 (diff)
downloadredmine-e8bc0b298007fad76fbcaa26bd91faea1ef23c9e.tar.gz
redmine-e8bc0b298007fad76fbcaa26bd91faea1ef23c9e.zip
Do not disable text selection in the issue list.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3543 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'public')
-rw-r--r--public/javascripts/context_menu.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/public/javascripts/context_menu.js b/public/javascripts/context_menu.js
index bd3b72618..04b65798e 100644
--- a/public/javascripts/context_menu.js
+++ b/public/javascripts/context_menu.js
@@ -8,13 +8,6 @@ ContextMenu.prototype = {
initialize: function (url) {
this.url = url;
this.createMenu();
-
- // prevent text selection in the issue list
- var tables = $$('table.issues');
- for (i=0; i<tables.length; i++) {
- tables[i].onselectstart = function () { return false; } // ie
- tables[i].onmousedown = function () { return false; } // mozilla
- }
if (!observingContextMenuClick) {
Event.observe(document, 'click', this.Click.bindAsEventListener(this));
@@ -167,6 +160,7 @@ ContextMenu.prototype = {
addSelection: function(tr) {
tr.addClassName('context-menu-selection');
this.checkSelectionBox(tr, true);
+ this.clearDocumentSelection();
},
toggleSelection: function(tr) {
@@ -196,6 +190,14 @@ ContextMenu.prototype = {
isSelected: function(tr) {
return Element.hasClassName(tr, 'context-menu-selection');
+ },
+
+ clearDocumentSelection: function() {
+ if (document.selection) {
+ document.selection.clear(); // IE
+ } else {
+ window.getSelection().removeAllRanges();
+ }
}
}