Skip to content

Commit

Permalink
add fixed button
Browse files Browse the repository at this point in the history
  • Loading branch information
cg33 committed Mar 15, 2020
1 parent 485d4ee commit a40bdde
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 68 deletions.
66 changes: 33 additions & 33 deletions adminlte/resource/assets.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion adminlte/resource/assets/dist/js/all_2.min.js

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

14 changes: 14 additions & 0 deletions common/assets/js/all_2/o_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,31 @@ function checkNavLength() {
return $('#firstnav').width() * 0.6 - $('.nav-addtabs').width() >= 120;
}

const fixedKey = "go_admin__sidebar_fixed";

$(function () {
let isFixed = window.localStorage.getItem(fixedKey);
if (isFixed === "true") {
$('.main-sidebar').css('position', 'fixed');
$('.main-header .logo').css('position', 'fixed');
$('.fixed-btn').attr('data-click', 'true');
}
});


$('.fixed-btn').on('click', function () {
let clicked = $(this).attr('data-click');
if (clicked === "false") {
$('.main-sidebar').css('position', 'fixed');
$('.main-header .logo').css('position', 'fixed');
$(this).attr('data-click', 'true');
window.localStorage.setItem(fixedKey, "true");
$(this).css('background-color', '#f3f3f3');
} else {
$('.main-sidebar').css('position', '');
$('.main-header .logo').css('position', '');
$(this).attr('data-click', 'false');
window.localStorage.removeItem(fixedKey);
$(this).css('background-color', 'white');
}
});
66 changes: 33 additions & 33 deletions sword/resource/assets.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sword/resource/assets/dist/js/all_2.min.js

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

0 comments on commit a40bdde

Please sign in to comment.