@@ -8,13 +8,6 ContextMenu.prototype = { | |||||
8 | initialize: function (url) { |
|
8 | initialize: function (url) { | |
9 | this.url = url; |
|
9 | this.url = url; | |
10 | this.createMenu(); |
|
10 | this.createMenu(); | |
11 |
|
||||
12 | // prevent text selection in the issue list |
|
|||
13 | var tables = $$('table.issues'); |
|
|||
14 | for (i=0; i<tables.length; i++) { |
|
|||
15 | tables[i].onselectstart = function () { return false; } // ie |
|
|||
16 | tables[i].onmousedown = function () { return false; } // mozilla |
|
|||
17 | } |
|
|||
18 |
|
11 | |||
19 | if (!observingContextMenuClick) { |
|
12 | if (!observingContextMenuClick) { | |
20 | Event.observe(document, 'click', this.Click.bindAsEventListener(this)); |
|
13 | Event.observe(document, 'click', this.Click.bindAsEventListener(this)); | |
@@ -167,6 +160,7 ContextMenu.prototype = { | |||||
167 | addSelection: function(tr) { |
|
160 | addSelection: function(tr) { | |
168 | tr.addClassName('context-menu-selection'); |
|
161 | tr.addClassName('context-menu-selection'); | |
169 | this.checkSelectionBox(tr, true); |
|
162 | this.checkSelectionBox(tr, true); | |
|
163 | this.clearDocumentSelection(); | |||
170 | }, |
|
164 | }, | |
171 |
|
165 | |||
172 | toggleSelection: function(tr) { |
|
166 | toggleSelection: function(tr) { | |
@@ -196,6 +190,14 ContextMenu.prototype = { | |||||
196 |
|
190 | |||
197 | isSelected: function(tr) { |
|
191 | isSelected: function(tr) { | |
198 | return Element.hasClassName(tr, 'context-menu-selection'); |
|
192 | return Element.hasClassName(tr, 'context-menu-selection'); | |
|
193 | }, | |||
|
194 | ||||
|
195 | clearDocumentSelection: function() { | |||
|
196 | if (document.selection) { | |||
|
197 | document.selection.clear(); // IE | |||
|
198 | } else { | |||
|
199 | window.getSelection().removeAllRanges(); | |||
|
200 | } | |||
199 | } |
|
201 | } | |
200 | } |
|
202 | } | |
201 |
|
203 |
General Comments 0
You need to be logged in to leave comments.
Login now