remove old MDL wrapper directives (#2095)

- remove mdl-button directive
- remove mdl-tooltip directive
This commit is contained in:
Denys Vuika
2017-07-18 10:34:44 +01:00
committed by Eugenio Romano
parent 914e2af98d
commit 34c89bd2ba
7 changed files with 12 additions and 83 deletions

View File

@@ -18,7 +18,7 @@
</div>
<div *ngIf="showOutcomeButtons && form.hasOutcomes()" class="mdl-card__actions mdl-card--border" #outcomesContainer>
<button *ngFor="let outcome of form.outcomes"
alfresco-mdl-button
md-button
[disabled]="!isOutcomeButtonEnabled(outcome)"
[class.mdl-button--colored]="!outcome.isSystem"
[class.activiti-form-hide-button]="!isOutcomeButtonVisible(outcome, form.readOnly)"

View File

@@ -3,10 +3,10 @@
<h4 class="container-widget__header-text" id="container-header"
[class.collapsible]="content?.isCollapsible()">
<button *ngIf="content?.isCollapsible()"
alfresco-mdl-button
md-icon-button
class="mdl-button--icon"
(click)="onExpanderClicked()">
<i class="material-icons">{{ content?.isExpanded ? 'expand_less' : 'expand_more' }}</i>
<md-icon>{{ content?.isExpanded ? 'expand_less' : 'expand_more' }}</md-icon>
</button>
<span (click)="onExpanderClicked()" id="container-header-label">{{content.name}}</span>
</h4>

View File

@@ -98,10 +98,8 @@ import { UploadDirective } from './src/directives/upload.directive';
import { FileSizePipe } from './src/pipes/file-size.pipe';
import { HighlightPipe } from './src/pipes/text-highlight.pipe';
import { AlfrescoMdlButtonDirective } from './src/components/material/mdl-button.directive';
import { AlfrescoMdlMenuDirective } from './src/components/material/mdl-menu.directive';
import { AlfrescoMdlTextFieldDirective } from './src/components/material/mdl-textfield.directive';
import { AlfrescoMdlTooltipDirective } from './src/components/material/mdl-tooltip.directive';
import { MDLDirective } from './src/components/material/mdl-upgrade-element.directive';
export { ContextMenuModule } from './src/components/context-menu/context-menu.module';

View File

@@ -1,38 +0,0 @@
/*!
* @license
* Copyright 2016 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AfterViewInit, Directive, ElementRef } from '@angular/core';
declare var componentHandler;
@Directive({
selector: '[adf-mdl-button] ,[alfresco-mdl-button]'
})
export class AlfrescoMdlButtonDirective implements AfterViewInit {
constructor(private element: ElementRef) {}
ngAfterViewInit() {
if (componentHandler) {
let el = this.element.nativeElement;
el.classList.add('mdl-button');
el.classList.add('mdl-js-button');
el.classList.add('mdl-js-ripple-effect');
componentHandler.upgradeElement(el, 'MaterialButton');
}
}
}

View File

@@ -1,36 +0,0 @@
/*!
* @license
* Copyright 2016 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AfterViewInit, Directive, ElementRef } from '@angular/core';
declare var componentHandler;
@Directive({
selector: '[alfresco-mdl-tooltip]'
})
export class AlfrescoMdlTooltipDirective implements AfterViewInit {
constructor(private element: ElementRef) {}
ngAfterViewInit() {
if (componentHandler) {
let el = this.element.nativeElement;
el.classList.add('mdl-tooltip');
componentHandler.upgradeElement(el, 'MaterialTooltip');
}
}
}

View File

@@ -22,6 +22,11 @@ declare var componentHandler;
selector: '[mdl]'
})
export class MDLDirective implements AfterViewInit {
constructor() {
console.log('MDLDirective is deprecated and should not be used.');
}
ngAfterViewInit() {
componentHandler.upgradeAllRegistered();
}

View File

@@ -16,12 +16,12 @@
<span class="mdl-paging__count">{{summary}}</span>
<button (click)="showPrevPage()"
[disabled]="!prevPageAvail()"
alfresco-mdl-button class="mdl-button--icon mdl-paging__prev">
<i class="material-icons">keyboard_arrow_left</i>
md-icon-button class="mdl-button--icon mdl-paging__prev">
<md-icon>keyboard_arrow_left</md-icon>
</button>
<button (click)="showNextPage()"
[disabled]="!nextPageAvail()"
alfresco-mdl-button class="mdl-button--icon mdl-paging__next">
<i class="material-icons">keyboard_arrow_right</i>
md-icon-button class="mdl-button--icon mdl-paging__next">
<md-icon>keyboard_arrow_right</md-icon>
</button>
</div>