- Removed generic.sass import

- Error class management refactor
pull/8281/head
Aleix Suau 5 years ago
parent 7811c9ba36
commit 4eee2913c3
  1. 2
      app/assets/stylesheets/openproject/_generic.sass
  2. 22
      frontend/src/app/components/resizer/wp-resizer.component.ts
  3. 1
      modules/bim/app/assets/stylesheets/bim/ifc_viewer/generic.sass

@ -118,4 +118,4 @@
z-index: 0 !important
.-error
color: $content-form-error-color
color: $content-form-error-color !important

@ -146,9 +146,7 @@ export class WpResizerDirective extends UntilDestroyedMixin implements OnInit, A
const event = new Event(this.resizeEvent);
window.dispatchEvent(event);
if (this.resizer.classList.contains('-error')) {
this.resizer.classList.remove('-error');
}
this.manageErrorClass(false);
}
resizeMove(deltas:ResizeDelta) {
@ -164,15 +162,11 @@ export class WpResizerDirective extends UntilDestroyedMixin implements OnInit, A
newValue = this.elementMinWidth;
// Show the resizer red when it reaches its limit (min-width)
if (!this.resizer.classList.contains('-error')) {
this.resizer.classList.add('-error');
}
this.manageErrorClass(true);
} else {
newValue = this.elementWidth;
if (this.resizer.classList.contains('-error')) {
this.resizer.classList.remove('-error');
}
this.manageErrorClass(false);
}
// Store item in local storage
@ -218,4 +212,14 @@ export class WpResizerDirective extends UntilDestroyedMixin implements OnInit, A
let fullScreenLeftView = jQuery('.work-packages-full-view--split-left')[0];
this.toggleColumns(fullScreenLeftView);
}
private manageErrorClass(shouldBePresent:boolean) {
  if (shouldBePresent && !this.resizer.classList.contains('-error')) {
   this.resizer.classList.add('-error');
  }
if (!shouldBePresent && this.resizer.classList.contains('-error')) {
this.resizer.classList.remove('-error');
}
}
}

@ -1,7 +1,6 @@
// -------------------------- GENERIC --------------------------
@import "openproject/variables"
@import "openproject/mixins"
@import "openproject/generic"
@import "fonts/openproject_icon_definitions"
@import "fonts/openproject_icon_font"

Loading…
Cancel
Save