Skip to content

Commit

Permalink
fix sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Bohollo committed Dec 24, 2019
1 parent 0eec3d4 commit c182cd0
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 58 deletions.
2 changes: 1 addition & 1 deletion src/resources/dist/mage.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/resources/dist/mage.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/resources/dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"/mage.js": "/mage.js?id=7636a57a18169a97bf5b",
"/mage.css": "/mage.css?id=8e9a136b5efc5e041a21"
"/mage.js": "/mage.js?id=13dc1aabd3ec36351609",
"/mage.css": "/mage.css?id=7ce8ee301a306256dbf3"
}
50 changes: 25 additions & 25 deletions src/resources/js/app/components/options.datatables.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
jQ(document).ready(function () {
jQ('#nav-toggle').on('click', function(e) {
jQ('#nav-toggle').on('click', function (e) {
setTimeout(() => {
jQ(jQ.fn.dataTable.tables()).DataTable().draw('page')
}, 100)
}, 300)
});

window.dataTablesLocales = function() {
return {
"sProcessing" : trans('mage.datatables.sProcessing'),
"sLengthMenu" : trans('mage.datatables.sLengthMenu'),
"sZeroRecords" : trans('mage.datatables.sZeroRecords'),
"sEmptyTable" : trans('mage.datatables.sEmptyTable'),
"sInfo" : trans('mage.datatables.sInfo'),
"sInfoEmpty" : trans('mage.datatables.sInfoEmpty'),
"sInfoFiltered" : trans('mage.datatables.sInfoFiltered'),
"sInfoPostFix" : trans('mage.datatables.sInfoPostFix'),
"sSearch" : trans('mage.datatables.sSearch'),
"sUrl" : trans('mage.datatables.sUrl'),
"sInfoThousands" : trans('mage.datatables.sInfoThousands'),
"sLoadingRecords" : trans('mage.datatables.sLoadingRecords'),
"oPaginate" : {
"sFirst" : trans('mage.datatables.oPaginate.sFirst'),
"sLast" : trans('mage.datatables.oPaginate.sLast'),
"sNext" : trans('mage.datatables.oPaginate.sNext'),
"sPrevious" : trans('mage.datatables.oPaginate.sPrevious')
window.dataTablesLocales = function () {
return {
"sProcessing": trans('mage.datatables.sProcessing'),
"sLengthMenu": trans('mage.datatables.sLengthMenu'),
"sZeroRecords": trans('mage.datatables.sZeroRecords'),
"sEmptyTable": trans('mage.datatables.sEmptyTable'),
"sInfo": trans('mage.datatables.sInfo'),
"sInfoEmpty": trans('mage.datatables.sInfoEmpty'),
"sInfoFiltered": trans('mage.datatables.sInfoFiltered'),
"sInfoPostFix": trans('mage.datatables.sInfoPostFix'),
"sSearch": trans('mage.datatables.sSearch'),
"sUrl": trans('mage.datatables.sUrl'),
"sInfoThousands": trans('mage.datatables.sInfoThousands'),
"sLoadingRecords": trans('mage.datatables.sLoadingRecords'),
"oPaginate": {
"sFirst": trans('mage.datatables.oPaginate.sFirst'),
"sLast": trans('mage.datatables.oPaginate.sLast'),
"sNext": trans('mage.datatables.oPaginate.sNext'),
"sPrevious": trans('mage.datatables.oPaginate.sPrevious')
},
"oAria" : {
"sSortAscending" : trans('mage.datatables.oAria.sSortAscending'),
"sSortDescending" : trans('mage.datatables.oAria.sSortDescending')
"oAria": {
"sSortAscending": trans('mage.datatables.oAria.sSortAscending'),
"sSortDescending": trans('mage.datatables.oAria.sSortDescending')
}
}
}
});
});
64 changes: 39 additions & 25 deletions src/resources/js/app/components/overlayScrollbars.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,53 @@
jQ(document).ready(function () {
let options = {
className : "os-theme-dark",
resize : "none",
sizeAutoCapable : true,
clipAlways : true,
normalizeRTL : true,
paddingAbsolute : false,
autoUpdate : null,
autoUpdateInterval : 33,
nativeScrollbarsOverlaid : {
showNativeScrollbars : false,
initialize : true
className: "os-theme-dark",
resize: "none",
sizeAutoCapable: true,
clipAlways: true,
normalizeRTL: true,
paddingAbsolute: false,
autoUpdate: null,
autoUpdateInterval: 33,
nativeScrollbarsOverlaid: {
showNativeScrollbars: false,
initialize: true
},
overflowBehavior : {
x : "scroll",
y : "scroll"
overflowBehavior: {
x: "scroll",
y: "scroll"
},
scrollbars : {
visibility : "auto",
autoHide : "move",
autoHideDelay : 800,
dragScrolling : true,
clickScrolling : false,
touchSupport : true
scrollbars: {
visibility: "auto",
autoHide: "move",
autoHideDelay: 800,
dragScrolling: true,
clickScrolling: false,
touchSupport: true
}
};

if( jQ('.overlayscroll').not('.scrollDown').length ) {
if (jQ('.overlayscroll').not('.scrollDown').length) {
jQ('.overlayscroll').not('.scrollDown').overlayScrollbars(options);
}

if( jQ('.overlayscroll.scrollDown').length ) {
jQ('.overlayscroll.scrollDown').overlayScrollbars(options).overlayScrollbars().scroll({ y : "100%" });
if (jQ('.overlayscroll.scrollDown').length) {
jQ('.overlayscroll.scrollDown').overlayScrollbars(options).overlayScrollbars().scroll({ y: "100%" });
}

OverlayScrollbars(document.querySelectorAll('.wrapper'), options);
OverlayScrollbars(document.querySelectorAll('.sidebar-mini'), options);
OverlayScrollbars(document.querySelectorAll('.sidebar'), options);

if (jQ("body").hasClass("sidebar-open")) {
jQ('.wrapper').append('<div id="sidebar-overlay"></div>')

jQ("#sidebar-overlay").on("click", function () {
jQ("body").removeClass("sidebar-open")
jQ("body").addClass("sidebar-collapse")
axios
.post(route('mage.sidebar.toggle'), { isShown: "true" })
.catch((error) => {
console.error(error);
});
});
}
});
10 changes: 6 additions & 4 deletions src/resources/sass/custom/sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Nav - sidebar
}

.box-block {
display: block;
display: block;
text-decoration: none;
color: #7a878e;
outline: 0;
Expand Down Expand Up @@ -59,8 +59,10 @@ Nav - sidebar
margin-right: 0.8rem;
}

.brand-link {
.brand-link {
background: #1e88e5;
height:54px;

.brand-image {
float: left;
line-height: 0.8;
Expand Down Expand Up @@ -204,7 +206,7 @@ li.nav-item.has-treeview.menu-open > a:after {

&:first-child {
margin-top: 0px;
}
}
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-treeview {
Expand All @@ -213,4 +215,4 @@ li.nav-item.has-treeview.menu-open > a:after {

.nav-sidebar .nav-header:not(:first-of-type) {
padding: 1rem 1rem 0.8rem 1rem;
}
}

0 comments on commit c182cd0

Please sign in to comment.