Skip to content

Commit

Permalink
Better fix context-menu position
Browse files Browse the repository at this point in the history
  • Loading branch information
gagnieray committed Mar 23, 2023
1 parent a1f1307 commit c802813
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion javascripts/theme.js

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

10 changes: 2 additions & 8 deletions src/javascripts/modules/SidebarToggler.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ PurpleMine.SidebarToggler = (function () {
this.sidebarVisible = true
this.sidebarHiding = null
this.$toggler = null
this.$header = $('#header')
this.$main = $('#main')
this.$sidebar = $('#sidebar')
this.lang = document.documentElement.lang
Expand All @@ -42,13 +43,6 @@ PurpleMine.SidebarToggler = (function () {

this._ = translations[this.lang]

// Fix issue with context menu position
if (this.$main.css('position') === 'relative') {
$(window).on('load', function () {
$('#context-menu').appendTo('#wrapper')
})
}

handleSidebar()
}

Expand Down Expand Up @@ -96,7 +90,7 @@ PurpleMine.SidebarToggler = (function () {
'"></a>'
instance.$toggler = $(togglerHtml)

instance.$main.append(instance.$toggler)
instance.$header.append(instance.$toggler)
instance.$toggler.on('click', instance.toggleSidebar)
}

Expand Down
2 changes: 0 additions & 2 deletions src/sass/components/_context-menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
}

#context-menu {
position: fixed;

> ul,
> ul > li > ul {
@include nice-shadow(2);
Expand Down
6 changes: 3 additions & 3 deletions src/sass/javascripts/_sidebar-toggler.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@if $enable-sidebar-toggler {
#main {
position: relative;

// Fix full screen view for dashboard plugin
// https://github.com/jgraichen/redmine_dashboard
@at-root .controller-rdb_taskboard & {
Expand Down Expand Up @@ -38,9 +36,11 @@
.sidebar-toggler {
display: block;
position: absolute;
top: 1px;
z-index: 2;
bottom: -1px;
width: 14px;
height: 16px;
transform: translateY(100%);
border: 2px solid $gray-700;
border-radius: $border-radius-base;
background-color: $gray-200;
Expand Down
2 changes: 1 addition & 1 deletion stylesheets/application.css

Large diffs are not rendered by default.

0 comments on commit c802813

Please sign in to comment.