parent
6541cbe073
commit
1a8090402f
@ -0,0 +1,49 @@ |
||||
// -- copyright
|
||||
// OpenProject is a project management system.
|
||||
// Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License version 3.
|
||||
//
|
||||
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
||||
// Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
// Copyright (C) 2010-2013 the ChiliProject Team
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
// See doc/COPYRIGHT.rdoc for more details.
|
||||
// ++
|
||||
|
||||
import {QueryResource} from 'core-app/modules/hal/resources/query-resource'; |
||||
import {HighlightingMode} from "core-components/wp-fast-table/builders/highlighting/highlighting-mode.const"; |
||||
import {HalResource} from "core-app/modules/hal/resources/hal-resource"; |
||||
|
||||
export class WorkPackageTableHighlight { |
||||
constructor(public mode:HighlightingMode = 'inline', |
||||
public selectedAttributes:HalResource[]|undefined = undefined) { |
||||
} |
||||
|
||||
public update(query:QueryResource|null) { |
||||
if (!query) { |
||||
this.mode = 'inline'; |
||||
this.selectedAttributes = undefined; |
||||
return; |
||||
} |
||||
|
||||
|
||||
this.mode = query.highlightingMode; |
||||
this.selectedAttributes = query.selectedAttributes; |
||||
} |
||||
} |
@ -0,0 +1,53 @@ |
||||
// -- copyright
|
||||
// OpenProject is a project management system.
|
||||
// Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License version 3.
|
||||
//
|
||||
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
||||
// Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
// Copyright (C) 2010-2013 the ChiliProject Team
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
// See doc/COPYRIGHT.rdoc for more details.
|
||||
// ++
|
||||
|
||||
import {Inject, Injectable} from '@angular/core'; |
||||
import {DOCUMENT} from "@angular/common"; |
||||
import {PathHelperService} from "../path-helper/path-helper.service"; |
||||
|
||||
@Injectable() |
||||
export class BannersService { |
||||
|
||||
private readonly _banners:boolean = true; |
||||
|
||||
constructor(@Inject(DOCUMENT) protected documentElement:Document) { |
||||
this._banners = documentElement.body.classList.contains('ee-banners-visible'); |
||||
} |
||||
|
||||
public get eeShowBanners():boolean { |
||||
return this._banners; |
||||
} |
||||
|
||||
public conditional(bannersVisible?:() => void, bannersNotVisible?:() => void) { |
||||
this._banners ? this.callMaybe(bannersVisible) : this.callMaybe(bannersNotVisible); |
||||
} |
||||
|
||||
private callMaybe(func?:Function) { |
||||
func && func(); |
||||
} |
||||
} |
Loading…
Reference in new issue