diff --git a/_static/accounting.css b/_static/accounting.css index a08136ab6..df279a479 100644 --- a/_static/accounting.css +++ b/_static/accounting.css @@ -13,8 +13,9 @@ background-color: hsl(219, 67%, 94%); } -#chart-controls label:hover, -#entries-control label:hover { +label:hover, +label:hover, +.highlighter-list li:hover { background-color: hsl(0, 0%, 94%); cursor: pointer; } @@ -86,15 +87,19 @@ } @media (min-width: 992px) { - .accounts-table { + .accounts-table, .force-right .highlighter-target { font-size: 90%; color: #888 !important; } - .accounts-table .related { + .force-right .highlighter-target th { + font-weight: normal; + font-size: 110%; + } + .accounts-table .related, .force-right .highlighter-target .related { background-color: transparent !important; color: #eee !important; } - .accounts-table .secondary { + .accounts-table .secondary, .force-right .highlighter-target .secondary { background-color: transparent !important; color: #aaa !important; } diff --git a/_static/misc.js b/_static/misc.js index f139777ff..b432df5ab 100644 --- a/_static/misc.js +++ b/_static/misc.js @@ -1,9 +1,27 @@ (function () { document.addEventListener('DOMContentLoaded', function () { - alternatives() + alternatives(); + highlight(); checks_handling(); }); + function highlight() { + $('.highlighter-list').each(function () { + var $this = $(this), + $target = $($this.data('target')); + $this.on('mouseout', 'li', function (e) { + $(e.currentTarget).removeClass('secondary'); + $target.find('.related').removeClass('related'); + }).on('mouseover', 'li', function (e) { + if (!e.currentTarget.contains(e.target)) { return; } + + var $li = $(e.currentTarget); + console.log($li, $li.data('highlight'), $target.find($li.data('highlight'))); + $li.addClass('secondary'); + $target.find($li.data('highlight')).addClass('related'); + }); + }); + } /** alternatives display: * - prepend control for each
Location | Value | +
---|---|
Physical Locations | $1,000 | +
Warehouse 1 | $600 | +
Warehouse 2 | $400 | +
Partner Locations | - $1,500 | +
Customers | $2,000 | +
Suppliers | - $3,500 | +
Virtual Locations | $500 | +
Transit Location | $600 | +
Initial Inventory | $0 | +
Inventory Loss | $350 | +
Scraped | $550 | +
Manufacturing | - $1,000 | +