зеркало из 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,14 +55,14 @@
|
||||||
|
|
||||||
<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 = {};
|
||||||
|
@ -628,16 +629,18 @@
|
||||||
if (row.value == -1)
|
if (row.value == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (obj.value != "twisty") {
|
if (obj.value != "twisty") {
|
||||||
var column = document.getElementById(col.value);
|
var column = document.getElementById(col.value);
|
||||||
var cycler = column.hasAttribute('cycler');
|
var cycler = column.hasAttribute('cycler');
|
||||||
|
|
||||||
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]]>
|
]]>
|
||||||
</handler>
|
</handler>
|
||||||
|
@ -649,40 +652,48 @@
|
||||||
if (event.button != 0) return;
|
if (event.button != 0) return;
|
||||||
var row = {};
|
var row = {};
|
||||||
var col = {};
|
var col = {};
|
||||||
var obj = {};
|
var obj = {};
|
||||||
var b = this.parentNode.outlinerBoxObject;
|
var b = this.parentNode.outlinerBoxObject;
|
||||||
b.getCellAt(event.clientX, event.clientY, row, col, obj);
|
b.getCellAt(event.clientX, event.clientY, row, col, obj);
|
||||||
|
|
||||||
if (row.value == -1)
|
if (row.value == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (obj.value == "twisty") {
|
if (obj.value == "twisty") {
|
||||||
b.view.toggleOpenState(row.value);
|
b.view.toggleOpenState(row.value);
|
||||||
return;
|
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;
|
|
||||||
}
|
}
|
||||||
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
|
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
|
||||||
selected group of items */
|
selected group of items */
|
||||||
|
|
||||||
if (!col.value) return;
|
if (!col.value) return;
|
||||||
var column = document.getElementById(col.value);
|
var column = document.getElementById(col.value);
|
||||||
var cycler = column.hasAttribute('cycler');
|
var cycler = column.hasAttribute('cycler');
|
||||||
|
|
||||||
// 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>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче