From 81099a6ee1c61896c588fffb3c515707be5c61c7 Mon Sep 17 00:00:00 2001 From: "varga%utcru.sk" Date: Sat, 9 Feb 2002 04:17:23 +0000 Subject: [PATCH] Fix for bugs: 91154 - threadpane / outliner autoscroll when clicking on last visible row 103243 - xul file picker: Ctrl+click moves focus ring, but not highlight r=bryner, sr=hyatt --- .../resources/content/bindings/outliner.xml | 89 +++++++++++-------- 1 file changed, 50 insertions(+), 39 deletions(-) diff --git a/xpfe/global/resources/content/bindings/outliner.xml b/xpfe/global/resources/content/bindings/outliner.xml index d8244c7a93a6..9c8e12ff3b81 100644 --- a/xpfe/global/resources/content/bindings/outliner.xml +++ b/xpfe/global/resources/content/bindings/outliner.xml @@ -55,14 +55,14 @@ @@ -615,7 +615,8 @@ click, so that drags work correctly. --> @@ -649,40 +652,48 @@ if (event.button != 0) return; var row = {}; var col = {}; - var obj = {}; + var obj = {}; var b = this.parentNode.outlinerBoxObject; b.getCellAt(event.clientX, event.clientY, row, col, obj); if (row.value == -1) return; - if (obj.value == "twisty") { + if (obj.value == "twisty") { b.view.toggleOpenState(row.value); - return; - } - - var augment = event.ctrlKey || event.metaKey; - if (event.shiftKey) - b.selection.rangedSelect(-1, row.value, augment); - else if (augment) { - b.selection.toggleSelect(row.value); - b.selection.currentIndex = row.value; + return; } - else { - /* We want to deselect all the selected items except what was + + if (! this.parentNode.singleSelection) { + var augment = event.ctrlKey || event.metaKey; + if (event.shiftKey) { + b.selection.rangedSelect(-1, row.value, augment); + b.ensureRowIsVisible(row.value); + return; + } + if (augment) { + b.selection.toggleSelect(row.value); + b.ensureRowIsVisible(row.value); + b.selection.currentIndex = row.value; + return; + } + } + + /* We want to deselect all the selected items except what was clicked, UNLESS it was a right-click. We have to do this in click rather than mousedown so that you can drag a selected group of items */ - if (!col.value) return; - var column = document.getElementById(col.value); - var cycler = column.hasAttribute('cycler'); + if (!col.value) return; + var column = document.getElementById(col.value); + var cycler = column.hasAttribute('cycler'); - // if the last row has changed in between the time we - // mousedown and the time we click, don't fire the select handler. - // see bug #92366 - if (!cycler && this._lastSelectedRow == row.value) - b.selection.select(row.value); + // if the last row has changed in between the time we + // mousedown and the time we click, don't fire the select handler. + // see bug #92366 + if (!cycler && this._lastSelectedRow == row.value) { + b.selection.select(row.value); + b.ensureRowIsVisible(row.value); } ]]>