From 34c89bd2badf317f668498f33391bb6fdd286f78 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Tue, 18 Jul 2017 10:34:44 +0100 Subject: [PATCH] remove old MDL wrapper directives (#2095) - remove mdl-button directive - remove mdl-tooltip directive --- .../src/components/start-form.component.html | 2 +- .../widgets/container/container.widget.html | 4 +- ng2-components/ng2-alfresco-core/index.ts | 2 - .../material/mdl-button.directive.ts | 38 ------------------- .../material/mdl-tooltip.directive.ts | 36 ------------------ .../material/mdl-upgrade-element.directive.ts | 5 +++ .../pagination/pagination.component.html | 8 ++-- 7 files changed, 12 insertions(+), 83 deletions(-) delete mode 100644 ng2-components/ng2-alfresco-core/src/components/material/mdl-button.directive.ts delete mode 100644 ng2-components/ng2-alfresco-core/src/components/material/mdl-tooltip.directive.ts diff --git a/ng2-components/ng2-activiti-form/src/components/start-form.component.html b/ng2-components/ng2-activiti-form/src/components/start-form.component.html index 04c6311f78..d5beaf2334 100644 --- a/ng2-components/ng2-activiti-form/src/components/start-form.component.html +++ b/ng2-components/ng2-activiti-form/src/components/start-form.component.html @@ -18,7 +18,7 @@
{{content.name}} diff --git a/ng2-components/ng2-alfresco-core/index.ts b/ng2-components/ng2-alfresco-core/index.ts index ebb8fa4bb2..1dda5e07d3 100644 --- a/ng2-components/ng2-alfresco-core/index.ts +++ b/ng2-components/ng2-alfresco-core/index.ts @@ -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'; diff --git a/ng2-components/ng2-alfresco-core/src/components/material/mdl-button.directive.ts b/ng2-components/ng2-alfresco-core/src/components/material/mdl-button.directive.ts deleted file mode 100644 index a98dde49a5..0000000000 --- a/ng2-components/ng2-alfresco-core/src/components/material/mdl-button.directive.ts +++ /dev/null @@ -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'); - } - } -} diff --git a/ng2-components/ng2-alfresco-core/src/components/material/mdl-tooltip.directive.ts b/ng2-components/ng2-alfresco-core/src/components/material/mdl-tooltip.directive.ts deleted file mode 100644 index e0224f1524..0000000000 --- a/ng2-components/ng2-alfresco-core/src/components/material/mdl-tooltip.directive.ts +++ /dev/null @@ -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'); - } - } -} diff --git a/ng2-components/ng2-alfresco-core/src/components/material/mdl-upgrade-element.directive.ts b/ng2-components/ng2-alfresco-core/src/components/material/mdl-upgrade-element.directive.ts index a03ef81c7f..4d29853546 100644 --- a/ng2-components/ng2-alfresco-core/src/components/material/mdl-upgrade-element.directive.ts +++ b/ng2-components/ng2-alfresco-core/src/components/material/mdl-upgrade-element.directive.ts @@ -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(); } diff --git a/ng2-components/ng2-alfresco-datatable/src/components/pagination/pagination.component.html b/ng2-components/ng2-alfresco-datatable/src/components/pagination/pagination.component.html index 88a809f7bd..3fe519bcd6 100644 --- a/ng2-components/ng2-alfresco-datatable/src/components/pagination/pagination.component.html +++ b/ng2-components/ng2-alfresco-datatable/src/components/pagination/pagination.component.html @@ -16,12 +16,12 @@ {{summary}}