Remove double click action on cell

This feature was a source of confusion for new pgweb users for quite
some time now. Most people thought by double-clicking the cell it
would allow them to edit the value since the column is replaced
with textarea. The textarea was there to copy the cell's value, not
for editing. Feature is no longer required due to availability of a
cell context menu, which provides a link to copy the value.
This commit is contained in:
Dan Sosedoff 2020-02-12 13:14:58 -06:00
parent dc390b552d
commit 6025b7afb2
3 changed files with 8 additions and 34 deletions

File diff suppressed because one or more lines are too long

View File

@ -538,12 +538,6 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: pre;
/*
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
*/
}
#results td div span.null {

View File

@ -1189,26 +1189,6 @@ $(document).ready(function() {
showTableContent(sortColumn, sortOrder);
});
$("#results").on("dblclick", "td > div", function() {
if ($(this).has("textarea").length > 0) {
return;
}
var value = unescapeHtml($(this).html());
if (!value) { return; }
var textarea = $("<textarea />").
text(value).
addClass("form-control").
css("width", $(this).css("width"));
if (value.split("\n").length >= 3) {
textarea.css("height", "200px");
}
$(this).html(textarea).css("max-height", "200px");
});
$("#refresh_tables").on("click", function() {
loadSchemas();
});