Resizer icon is not scrolling with content anymore

pull/6371/head
Inga Mai 6 years ago committed by Wieland Lindenthal
parent 95ebff5d5c
commit 04ddb1c7b0
  1. 4
      app/assets/stylesheets/layout/_work_packages_full_view.sass
  2. 11
      frontend/src/app/components/resizer/wp-resizer.component.ts

@ -144,9 +144,11 @@ body.controller-work_packages.full-create
.work-packages-full-view--resizer
.work-packages--resizer
height: 100vh
width: 18px
left: 0
left: -2px
&::before
position: sticky
left: -2px
.nosidebar

@ -28,7 +28,6 @@
import {ChangeDetectorRef, Component, ElementRef, HostListener, Injector, Input, OnDestroy, OnInit} from '@angular/core';
import {distinctUntilChanged} from 'rxjs/operators';
import {Subscription} from 'rxjs/Subscription';
import {untilComponentDestroyed} from 'ng2-rx-componentdestroyed';
import {MainMenuToggleService} from "core-components/resizer/main-menu-toggle.service";
@ -50,8 +49,6 @@ export class WpResizerDirective implements OnInit, OnDestroy {
public moving:boolean = false;
private subscription:Subscription;
constructor(readonly toggleService:MainMenuToggleService,
private elementRef:ElementRef) {
}
@ -88,17 +85,16 @@ export class WpResizerDirective implements OnInit, OnDestroy {
untilComponentDestroyed(this)
)
.subscribe( changeData => {
jQuery('.can-have-columns').toggleClass('-columns-2', jQuery('.work-packages-full-view--split-left')[0].offsetWidth > 750);
jQuery('.can-have-columns').toggleClass('-columns-2', jQuery('.work-packages-full-view--split-left').width() > 750);
});
jQuery(window).resize(function() {
jQuery('.can-have-columns').toggleClass('-columns-2', jQuery('.work-packages-full-view--split-left')[0].offsetWidth > 750);
jQuery('.can-have-columns').toggleClass('-columns-2', jQuery('.work-packages-full-view--split-left').width() > 750);
});
}
ngOnDestroy() {
// Reset the style when killing this directive, otherwise the style remains
this.resizingElement.style.flexBasis = null;
this.subscription.unsubscribe();
}
@HostListener('mousedown', ['$event'])
@ -182,8 +178,7 @@ export class WpResizerDirective implements OnInit, OnDestroy {
private applyColumnLayout(element:HTMLElement, newWidth:number) {
// Apply two column layout in fullscreen view of a workpackage
if (element === jQuery('.work-packages-full-view--split-right')[0]) {
let widthLeftCol = jQuery('.work-packages-full-view--split-left')[0].offsetWidth;
jQuery('.can-have-columns').toggleClass('-columns-2', widthLeftCol > 750);
jQuery('.can-have-columns').toggleClass('-columns-2', jQuery('.work-packages-full-view--split-left').width() > 750);
}
// Apply two column layout when details view of wp is open
else {

Loading…
Cancel
Save