зеркало из https://github.com/mozilla/pjs.git
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
This commit is contained in:
Родитель
1477bd1a97
Коммит
4f7245f1f5
|
@ -55,13 +55,13 @@
|
||||||
|
|
||||||
<property name="firstOrdinalColumn">
|
<property name="firstOrdinalColumn">
|
||||||
<getter><![CDATA[
|
<getter><![CDATA[
|
||||||
var xulns = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
var cols = this.firstChild;
|
||||||
var cols = this.getElementsByTagNameNS(xulns, "outlinercol");
|
while (cols && cols.localName != "outlinercols")
|
||||||
for (var i = 0; i < cols.length; ++i) {
|
cols = cols.nextSibling;
|
||||||
var parent = cols[i].boxObject.parentBox;
|
|
||||||
if (parent)
|
if (cols)
|
||||||
return parent.boxObject.firstChild;
|
return cols.boxObject.firstChild;
|
||||||
}
|
else
|
||||||
return null;
|
return null;
|
||||||
]]></getter>
|
]]></getter>
|
||||||
</property>
|
</property>
|
||||||
|
@ -615,7 +615,8 @@
|
||||||
click, so that drags work correctly. -->
|
click, so that drags work correctly. -->
|
||||||
<handler event="mousedown">
|
<handler event="mousedown">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
if (!event.ctrlKey && !event.shiftKey && !event.metaKey) {
|
if ((!event.ctrlKey && !event.shiftKey && !event.metaKey) ||
|
||||||
|
this.parentNode.singleSelection) {
|
||||||
var row = {};
|
var row = {};
|
||||||
var col = {};
|
var col = {};
|
||||||
var obj = {};
|
var obj = {};
|
||||||
|
@ -635,8 +636,10 @@
|
||||||
if (cycler)
|
if (cycler)
|
||||||
b.view.cycleCell(row.value, col.value);
|
b.view.cycleCell(row.value, col.value);
|
||||||
else
|
else
|
||||||
if (!b.selection.isSelected(row.value))
|
if (!b.selection.isSelected(row.value)) {
|
||||||
b.selection.select(row.value);
|
b.selection.select(row.value);
|
||||||
|
b.ensureRowIsVisible(row.value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]]>
|
]]>
|
||||||
|
@ -661,14 +664,21 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! this.parentNode.singleSelection) {
|
||||||
var augment = event.ctrlKey || event.metaKey;
|
var augment = event.ctrlKey || event.metaKey;
|
||||||
if (event.shiftKey)
|
if (event.shiftKey) {
|
||||||
b.selection.rangedSelect(-1, row.value, augment);
|
b.selection.rangedSelect(-1, row.value, augment);
|
||||||
else if (augment) {
|
b.ensureRowIsVisible(row.value);
|
||||||
b.selection.toggleSelect(row.value);
|
return;
|
||||||
b.selection.currentIndex = row.value;
|
|
||||||
}
|
}
|
||||||
else {
|
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
|
/* We want to deselect all the selected items except what was
|
||||||
clicked, UNLESS it was a right-click. We have to do this
|
clicked, UNLESS it was a right-click. We have to do this
|
||||||
in click rather than mousedown so that you can drag a
|
in click rather than mousedown so that you can drag a
|
||||||
|
@ -681,8 +691,9 @@
|
||||||
// if the last row has changed in between the time we
|
// if the last row has changed in between the time we
|
||||||
// mousedown and the time we click, don't fire the select handler.
|
// mousedown and the time we click, don't fire the select handler.
|
||||||
// see bug #92366
|
// see bug #92366
|
||||||
if (!cycler && this._lastSelectedRow == row.value)
|
if (!cycler && this._lastSelectedRow == row.value) {
|
||||||
b.selection.select(row.value);
|
b.selection.select(row.value);
|
||||||
|
b.ensureRowIsVisible(row.value);
|
||||||
}
|
}
|
||||||
]]>
|
]]>
|
||||||
</handler>
|
</handler>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче