Skip to content

Commit

Permalink
Merge pull request #53 from TheDMSGroup/ENG-403
Browse files Browse the repository at this point in the history
[ENG-403] make datatables scroll on dashboard and reduce font size
  • Loading branch information
heathdutton authored Jul 27, 2018
2 parents b67f901 + afaea53 commit 35efc53
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
9 changes: 7 additions & 2 deletions Assets/js/global-revenue.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Mautic.loadGlobalRevenueWidget = function () {
var $globaltarget = mQuery('#global-revenue');
var $globalwrapper = mQuery('#global-revenue_wrapper');
if ($globaltarget.length) {
mQuery('#global-revenue:not(.table-initialized):first').addClass('table-initialized').each(function () {
mQuery.getScriptCachedOnce(mauticBasePath + '/' + mauticAssetPrefix + 'plugins/MauticContactLedgerBundle/Assets/js/datatables.min.js', function () {
Expand All @@ -22,6 +23,7 @@ Mautic.loadGlobalRevenueWidget = function () {
},
data: response.rows,
autoFill: true,
autoWidth: true,
columns: response.columns,
order: [[2, 'asc']],
bLengthChange: false,
Expand Down Expand Up @@ -57,8 +59,8 @@ Mautic.loadGlobalRevenueWidget = function () {
targets: 10
},
{visible: false, targets: [1]},
{width: '5%', targets: [0]},
{width: '20%', targets: [2]}
// {width: '5%', targets: [0]},
// {width: '20%', targets: [2]}
],

footerCallback: function (row, data, start, end, display) {
Expand Down Expand Up @@ -122,6 +124,9 @@ Mautic.loadGlobalRevenueWidget = function () {
} // FooterCallback
}); //.DataTables
mQuery('#global-revenue_wrapper .dt-buttons').css({float: "right", marginLeft: "10px"});
mQuery('#global-revenue').css('width', 'auto');
mQuery('#global-revenue').css("font-size", ".8em")
mQuery('#global-revenue_wrapper').css('overflow-x', 'scroll');
} //success
}); //ajax
}); //getScriptsCachedOnce - fonteawesome css
Expand Down
9 changes: 6 additions & 3 deletions Assets/js/source-revenue.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ Mautic.loadSourceRevenueWidget = function () {
},
{visible: false, targets: [1, 3]},
{width: '5%', targets: [0]},
{width: '20%', targets: [2]},
{width: '15%', targets: [4]}
{width: '15%', targets: [2]},
{width: '12%', targets: [4]}
],

footerCallback: function (row, data, start, end, display) {
Expand All @@ -84,7 +84,7 @@ Mautic.loadSourceRevenueWidget = function () {
var tr2 = mQuery('<tr class=\'detailGrandTotal\' style=\'font-weight: 600; background: #fafafa;\'></tr>');
tr.append(mQuery('<td colspan=\'3\'>Page totals</td>'));
tr2.append(mQuery('<td colspan=\'3\'>Grand totals</td>'));
for (var i = 2; i < columns; i++) {
for (var i = 5; i < columns; i++) {
tr.append(mQuery('<td class=\'td-right\'></td>'));
tr2.append(mQuery('<td class=\'td-right\'></td>'));
}
Expand Down Expand Up @@ -134,6 +134,9 @@ Mautic.loadSourceRevenueWidget = function () {

}); //.DataTables
mQuery('#source-revenue_wrapper .dt-buttons').css({float: "right", marginLeft: "10px"});
mQuery('#source-revenue').css("width", "auto");
mQuery('#source-revenue').css("font-size", ".8em")
mQuery('#source-revenue_wrapper').css("overflow-x", "scroll");
} //success
});//ajax
}); //getScriptsCachedOnce - fonteawesome css
Expand Down

0 comments on commit 35efc53

Please sign in to comment.