[IMP] web_editor: restyle tables in editor
- reduce the default row height to get a padding of .5rem instead of .75 - use a darker grey for table border color task-2858455 Part-of: odoo/odoo#92200
This commit is contained in:
@@ -2224,7 +2224,7 @@ export class OdooEditor extends EventTarget {
|
||||
container.innerHTML = clipboardData;
|
||||
|
||||
for (const tableElement of container.querySelectorAll('table')) {
|
||||
tableElement.classList.add('table', 'table-bordered');
|
||||
tableElement.classList.add('table', 'table-bordered', 'o_table');
|
||||
}
|
||||
|
||||
for (const child of [...container.childNodes]) {
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
li.oe-nested {
|
||||
display: block;
|
||||
}
|
||||
.o_table tr td {
|
||||
padding: 0.5rem;
|
||||
border-color: #c9ccd2;
|
||||
}
|
||||
|
||||
@@ -834,7 +834,7 @@ export const editorCommands = {
|
||||
insertTable: (editor, { rowNumber = 2, colNumber = 2 } = {}) => {
|
||||
const tdsHtml = new Array(colNumber).fill('<td><p><br></p></td>').join('');
|
||||
const trsHtml = new Array(rowNumber).fill(`<tr>${tdsHtml}</tr>`).join('');
|
||||
const tableHtml = `<table class="table table-bordered"><tbody>${trsHtml}</tbody></table>`;
|
||||
const tableHtml = `<table class="table table-bordered o_table"><tbody>${trsHtml}</tbody></table>`;
|
||||
const sel = editor.document.getSelection();
|
||||
if (!sel.isCollapsed) {
|
||||
editor.deleteRange(sel);
|
||||
|
||||
Reference in New Issue
Block a user