Skip to content

Commit

Permalink
fixed layout added
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshadhin committed May 30, 2019
1 parent 28dcbb4 commit 95c628a
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 42 deletions.
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
"icheck": "^1.0.2",
"install": "^0.11.0",
"jquery": "^3.3.1",
"jquery-slimscroll": "^1.3.8",
"jquery-ui": "^1.12.1",
"jquery-validation": "^1.19.0",
"moment": "^2.23.0",
"popper.js": "^1.14.6",
"remove": "^0.1.5",
"select2": "^4.0.3",
"slimscroll": "^0.9.1",
"sweetalert2": "^7.33.1",
"toastr": "^2.1.4"
}
Expand Down
2 changes: 1 addition & 1 deletion resources/assets/backend/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if (token) {

require('icheck');
require('jquery-validation');
require('slimscroll');
require('jquery-slimscroll');
require('fastclick');
window.swal = require('sweetalert2');
require('select2');
Expand Down
59 changes: 21 additions & 38 deletions resources/assets/backend/js/theme_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,18 +311,7 @@ $(function () {
$pushMenu.expandOnHover()
if (!$('body').hasClass('sidebar-collapse'))
$('[data-layout="sidebar-collapse"]').click()
})

// Reset options
if ($('body').hasClass('fixed')) {
$('[data-layout="fixed"]').attr('checked', 'checked')
}
if ($('body').hasClass('layout-boxed')) {
$('[data-layout="layout-boxed"]').attr('checked', 'checked')
}
if ($('body').hasClass('sidebar-collapse')) {
$('[data-layout="sidebar-collapse"]').attr('checked', 'checked')
}
});

//menu collapse or expand
var isMenuCollapse = localStorage.getItem("menu-collapse");
Expand All @@ -335,22 +324,7 @@ $(function () {

}

// // Create the new tab
// var $tabPane = $('<div />', {
// 'id': 'control-sidebar-theme-demo-options-tab',
// 'class': 'tab-pane active'
// })

// // Create the tab button
// var $tabButton = $('<li />', { 'class': 'active' })
// .html('<a href=\'#control-sidebar-theme-demo-options-tab\' data-toggle=\'tab\'>'
// + '<i class="fa fa-wrench"></i>'
// + '</a>')

// // Add the tab button to the right sidebar tabs
// $('[href="#control-sidebar-home-tab"]')
// .parent()
// .before($tabButton)

// Create the menu
var $demoSettings = $('<div />')
Expand Down Expand Up @@ -502,18 +476,27 @@ $(function () {
$('#rightSideBarContent').append($demoSettings);

//sidebar menu active setter
var getUrl = window.location;
var baseUrl = getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split('/')[1];
var baseSubUrl = getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split('/')[1] + "/" + getUrl.pathname.split('/')[2];
var fullUrl = getUrl.href;
$(".sidebar-menu li a").each(function () {
if ($(this).attr("href") == fullUrl || $(this).attr("href") == baseUrl || $(this).attr("href") == baseSubUrl || $(this).attr("href") == '') {
$(".sidebar-menu li").removeClass('active');
$(this).parent().parent().parents('li').addClass("active");
$(this).parent().addClass("active");
}

// var getUrl = window.location;
// var baseUrl = getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split('/')[1];
// var baseSubUrl = getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split('/')[1] + "/" + getUrl.pathname.split('/')[2];
// var fullUrl = getUrl.href;
// $(".sidebar-menu li a").each(function () {
// if ($(this).attr("href") == fullUrl || $(this).attr("href") == baseUrl || $(this).attr("href") == baseSubUrl || $(this).attr("href") == '') {
// $(".sidebar-menu li").removeClass('active');
// $(this).parent().parent().parents('li').addClass("active");
// $(this).parent().addClass("active");
// }
//
// });
var url = window.location;
// Will only work if string in href matches with location
$('.sidebar-menu li a[href="' + url + '"]').parent().addClass('active');
// Will also work for relative and absolute hrefs
var activeMenuItem = $('.sidebar-menu li a').filter(function() {
return this.href == url;
});
activeMenuItem.parent().parent().parents('li').addClass('active');


//start setup startup page settings
setup();
Expand Down
2 changes: 1 addition & 1 deletion resources/views/backend/layouts/master.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<!-- Child Page css -->
</head>

<body class="hold-transition hold-transition skin-blue sidebar-mini @yield('bodyCssClass')">
<body class="hold-transition skin-blue sidebar-mini fixed @yield('bodyCssClass')">
{{--<div class="overlay-loader">--}}
{{--<div class="loader" ></div>--}}
{{--</div>--}}
Expand Down
2 changes: 1 addition & 1 deletion webpack.backend.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ mix.js('resources/assets/backend/js/app.js', 'public/js')
'resources/assets/backend/js/bootstrap-toggle.min.js',
], 'public/js/theme.js')
.extract([
'jquery', 'bootstrap', 'icheck', 'jquery-validation', 'slimscroll', 'fastclick',
'jquery', 'bootstrap', 'icheck', 'jquery-validation', 'jquery-slimscroll', 'fastclick',
'datatables.net', 'datatables.net-bs', 'datatables.net-responsive-bs'
])
.sass('resources/assets/backend/sass/app.scss', 'public/css')
Expand Down

0 comments on commit 95c628a

Please sign in to comment.