Commit 3a876caa authored by Roman Shevchuk's avatar Roman Shevchuk

Rewrited showLineNumbersInTables based on CSS numbering. Closed #5

parent 9477b06b
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
*/ */
html.salesforceuiimprover-enabledScript-showLineNumbersInTables #bodyCell table.list > * > tr > th:first-child::before, html.salesforceuiimprover-enabledScript-showLineNumbersInTables #bodyCell table.list > * > tr > th:first-child::before,
html.salesforceuiimprover-enabledScript-showLineNumbersInTables #bodyCell table.list > * > tr > td:first-child::before { html.salesforceuiimprover-enabledScript-showLineNumbersInTables #bodyCell table.list > * > tr > td:first-child::before {
content: attr(line-number); content: '#';
display: inline-block; display: inline-block;
color: #aaa; color: #aaa;
text-align: right; text-align: right;
...@@ -17,6 +17,15 @@ html.salesforceuiimprover-enabledScript-showLineNumbersInTables #bodyCell table. ...@@ -17,6 +17,15 @@ html.salesforceuiimprover-enabledScript-showLineNumbersInTables #bodyCell table.
padding-left: 2.8em; padding-left: 2.8em;
} }
html.salesforceuiimprover-enabledScript-showLineNumbersInTables #bodyCell table.list {
counter-reset: showLineNumbersInTables-counter;
}
html.salesforceuiimprover-enabledScript-showLineNumbersInTables #bodyCell table.list > * > tr:not(.headerRow) > th:first-child::before,
html.salesforceuiimprover-enabledScript-showLineNumbersInTables #bodyCell table.list > * > tr:not(.headerRow) > td:first-child::before {
content: counter(showLineNumbersInTables-counter);
counter-increment: showLineNumbersInTables-counter;
}
/* /*
* checkAllCheckboxes * checkAllCheckboxes
......
...@@ -163,19 +163,6 @@ var salesforceuiimprover_scripts = { ...@@ -163,19 +163,6 @@ var salesforceuiimprover_scripts = {
}, },
showLineNumbersInTables: function () { showLineNumbersInTables: function () {
var $bodyCell = $('#bodyCell');
$bodyCell.find('table.list > tbody').each(function () {
var index = 1;
$(this).children('tr:not(.headerRow)').children('*:first-child').each(function () {
$(this).attr('line-number', index);
index++;
});
});
$bodyCell.find('table.list > thead, table.list > tbody').children('tr.headerRow').children('th:first-child').each(function () {
$(this).attr('line-number', '#');
});
}, },
checkAllCheckboxes : function () { checkAllCheckboxes : function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment