зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1329907
, use opacity to clear the treecell text while editing instead of changing the value, r=jaws
This commit is contained in:
Родитель
b3651a7212
Коммит
cef415ae16
|
@ -384,14 +384,11 @@
|
||||||
}
|
}
|
||||||
setTimeout(selectText, 0);
|
setTimeout(selectText, 0);
|
||||||
|
|
||||||
// Clear the text because we don't want the text appearing underneath the input.
|
|
||||||
this.view.setCellText(row, column, "");
|
|
||||||
// Save the original text so we can restore it after stoping editing.
|
|
||||||
input.setAttribute("data-original-text", input.value);
|
|
||||||
|
|
||||||
this._editingRow = row;
|
this._editingRow = row;
|
||||||
this._editingColumn = column;
|
this._editingColumn = column;
|
||||||
this.setAttribute("editing", "true");
|
this.setAttribute("editing", "true");
|
||||||
|
|
||||||
|
box.invalidateCell(row, column);
|
||||||
return true;
|
return true;
|
||||||
]]>
|
]]>
|
||||||
</body>
|
</body>
|
||||||
|
@ -407,15 +404,16 @@
|
||||||
var input = this.inputField;
|
var input = this.inputField;
|
||||||
var editingRow = this._editingRow;
|
var editingRow = this._editingRow;
|
||||||
var editingColumn = this._editingColumn;
|
var editingColumn = this._editingColumn;
|
||||||
var value = accept ? input.value : input.getAttribute("data-original-text");
|
|
||||||
this._editingRow = -1;
|
this._editingRow = -1;
|
||||||
this._editingColumn = null;
|
this._editingColumn = null;
|
||||||
this.view.setCellText(editingRow, editingColumn, value);
|
|
||||||
|
|
||||||
|
if (accept) {
|
||||||
|
var value = input.value;
|
||||||
|
this.view.setCellText(editingRow, editingColumn, value);
|
||||||
|
}
|
||||||
input.hidden = true;
|
input.hidden = true;
|
||||||
input.value = "";
|
input.value = "";
|
||||||
this.removeAttribute("editing");
|
this.removeAttribute("editing");
|
||||||
input.removeAttribute("data-original-text");
|
|
||||||
]]>
|
]]>
|
||||||
</body>
|
</body>
|
||||||
</method>
|
</method>
|
||||||
|
@ -1237,8 +1235,10 @@
|
||||||
|
|
||||||
var cell = tbo.getCellAt(event.clientX, event.clientY);
|
var cell = tbo.getCellAt(event.clientX, event.clientY);
|
||||||
|
|
||||||
if (cell.childElt != "twisty")
|
if (cell.childElt != "twisty") {
|
||||||
|
view.selection.currentColumn = cell.col;
|
||||||
this.parentNode.startEditing(row, cell.col);
|
this.parentNode.startEditing(row, cell.col);
|
||||||
|
}
|
||||||
|
|
||||||
if (this.parentNode._editingColumn || !view.isContainer(row))
|
if (this.parentNode._editingColumn || !view.isContainer(row))
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -341,6 +341,17 @@ treechildren::-moz-tree-cell-text(selected, editing) {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
treechildren::-moz-tree-cell(active, selected, focus, editing),
|
||||||
|
tree[seltype="cell"] > treechildren::-moz-tree-cell(active, selected, focus, editing),
|
||||||
|
tree[seltype="text"] > treechildren::-moz-tree-cell(active, selected, focus, editing) {
|
||||||
|
background-color: transparent;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
treechildren::-moz-tree-cell-text(active, selected, editing) {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.tree-input {
|
.tree-input {
|
||||||
-moz-appearance: none;
|
-moz-appearance: none;
|
||||||
border: 1px solid Highlight;
|
border: 1px solid Highlight;
|
||||||
|
|
|
@ -283,3 +283,14 @@ treechildren.gridlines::-moz-tree-row {
|
||||||
margin-inline-start: -2px;
|
margin-inline-start: -2px;
|
||||||
padding: 2px 1px 1px;
|
padding: 2px 1px 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
treechildren::-moz-tree-cell(active, selected, focus, editing),
|
||||||
|
tree[seltype="cell"] > treechildren::-moz-tree-cell(active, selected, focus, editing),
|
||||||
|
tree[seltype="text"] > treechildren::-moz-tree-cell(active, selected, focus, editing) {
|
||||||
|
background-color: transparent;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
treechildren::-moz-tree-cell-text(active, selected, editing) {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
|
@ -370,6 +370,17 @@ treechildren::-moz-tree-cell-text(selected, editing) {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
treechildren::-moz-tree-cell(active, selected, focus, editing),
|
||||||
|
tree[seltype="cell"] > treechildren::-moz-tree-cell(active, selected, focus, editing),
|
||||||
|
tree[seltype="text"] > treechildren::-moz-tree-cell(active, selected, focus, editing) {
|
||||||
|
background-color: transparent;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
treechildren::-moz-tree-cell-text(active, selected, editing) {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.tree-input {
|
.tree-input {
|
||||||
-moz-appearance: none;
|
-moz-appearance: none;
|
||||||
border: 1px solid Highlight;
|
border: 1px solid Highlight;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче