46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
import { Component } from '@angular/core';
|
|
|
|
@Component({
|
|
selector: 'app-root',
|
|
templateUrl: './app.component.html',
|
|
styleUrls: ['./app.component.css'],
|
|
})
|
|
export class AppComponent {
|
|
/*
|
|
changeSidebarColor(color){
|
|
var sidebar = document.getElementsByClassName('sidebar')[0];
|
|
var mainPanel = document.getElementsByClassName('main-panel')[0];
|
|
|
|
this.sidebarColor = color;
|
|
|
|
if(sidebar != undefined){
|
|
sidebar.setAttribute('data',color);
|
|
}
|
|
if(mainPanel != undefined){
|
|
mainPanel.setAttribute('data',color);
|
|
}
|
|
}
|
|
*/
|
|
changeDashboardColor(color) {
|
|
var body = document.getElementsByTagName('body')[0];
|
|
if (body && color === 'white-content') {
|
|
body.classList.add(color);
|
|
} else if (body.classList.contains('white-content')) {
|
|
body.classList.remove('white-content');
|
|
}
|
|
}
|
|
// function that adds color white/transparent to the navbar on resize (this is for the collapse)
|
|
/*
|
|
updateColor = () => {
|
|
var navbar = document.getElementsByClassName('navbar')[0];
|
|
if (window.innerWidth < 993 && !this.isCollapsed) {
|
|
navbar.classList.add('bg-white');
|
|
navbar.classList.remove('navbar-transparent');
|
|
} else {
|
|
navbar.classList.remove('bg-white');
|
|
navbar.classList.add('navbar-transparent');
|
|
}
|
|
};
|
|
*/
|
|
}
|