From 39bd1bf42ab056ebd1da5748108765f822cd64fe Mon Sep 17 00:00:00 2001 From: Silvio Kennecke Date: Sun, 23 Sep 2018 17:44:13 +0200 Subject: [PATCH 1/4] Updated for materialize-css ^1.0.0 --- package.json | 2 +- src/index.ts | 4 ++-- src/materialize-directive.ts | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index cdb4555..aced9f4 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "gulp-typescript": "3.1.6", "hammerjs": "^2.0.8", "jquery": "^2.2.4", - "materialize-css": "^0.100.1", + "materialize-css": "^1.0.0", "rollup": "^0.41.6", "run-sequence": "1.2.2", "rxjs": "^5.1.0", diff --git a/src/index.ts b/src/index.ts index 1230d66..fefbc01 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,8 +1,8 @@ export {MaterializeDirective,MaterializeAction} from "./materialize-directive"; export {MaterializeModule} from "./materialize-module"; -if (!("Materialize" in window)) { - throw new Error("Couldn't find Materialize object on window. It is created by the materialize-css library. Please import materialize-css before importing angular2-materialize."); +if (!("M" in window)) { + throw new Error("Couldn't find M object on window. It is created by the materialize-css library. Please import materialize-css before importing angular2-materialize."); } if (!("Waves" in window)) { throw new Error("Couldn't find Waves object on window. It is supposed to be created by the materialize-css library. Please import materialize-css before importing angular2-materialize."); diff --git a/src/materialize-directive.ts b/src/materialize-directive.ts index 68365e6..6618b35 100644 --- a/src/materialize-directive.ts +++ b/src/materialize-directive.ts @@ -12,7 +12,7 @@ import { import {CustomEvent} from './custom-event-polyfill'; declare var $: any; -declare var Materialize: any; +declare var M: any; // export type MaterializeOptions = // "collapsible" | @@ -136,8 +136,8 @@ export class MaterializeDirective implements AfterViewInit,DoCheck,OnChanges,OnD private performElementUpdates() { // it should have been created by now, but confirm anyway - if (Materialize && Materialize.updateTextFields) { - Materialize.updateTextFields(); + if (M && M.updateTextFields) { + M.updateTextFields(); } // handle select changes from the HTML @@ -245,19 +245,19 @@ export class MaterializeDirective implements AfterViewInit,DoCheck,OnChanges,OnD jQueryElement[functionName](); } } else { - // fallback to running this function on the global Materialize object - if (Materialize[functionName]) { + // fallback to running this function on the global M object + if (M[functionName]) { if (params) { if (params instanceof Array) { - Materialize[functionName](...params); + M[functionName](...params); } else { throw new Error("Params has to be an array."); } } else { - Materialize[functionName](); + M[functionName](); } } else { - throw new Error("Couldn't find materialize function ''" + functionName + "' on element or the global Materialize object."); + throw new Error("Couldn't find materialize function ''" + functionName + "' on element or the global M object."); } } From ded5fa3ba15d3e04470d0df9a96d3e4b3bbfee49 Mon Sep 17 00:00:00 2001 From: Silvio Kennecke Date: Sun, 23 Sep 2018 17:50:21 +0200 Subject: [PATCH 2/4] Updated sample for materialize-css ^1.0.0 --- sample/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample/package.json b/sample/package.json index f8b7bf4..d810639 100644 --- a/sample/package.json +++ b/sample/package.json @@ -23,7 +23,7 @@ "hammerjs": "^2.0.8", "intl": "1.2.5", "jquery": "^2.2.4", - "materialize-css": "^0.100.1", + "materialize-css": "^1.0.0", "rxjs": "^5.1.0", "web-animations-js": "2.2.4", "zone.js": "0.8.7" From 26e3297a1cac4a440ca4ecdf7230b97a3351395d Mon Sep 17 00:00:00 2001 From: Silvio Kennecke Date: Sun, 23 Sep 2018 17:59:15 +0200 Subject: [PATCH 3/4] Updated node.js version for travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c7f5319..2ab0ca9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ branches: notifications: email: false node_js: - - '6' + - '10' before_install: # - npm i -g npm - npm i -g @angular/cli From 37c3a0ab9917005e2241270a13a7f3a5884b6cb7 Mon Sep 17 00:00:00 2001 From: Silvio Kennecke Date: Sun, 23 Sep 2018 18:48:47 +0200 Subject: [PATCH 4/4] Updated peerDependencies --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index aced9f4..807eaaa 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "postsemantic-release": "semantic-release post" }, "peerDependencies": { - "materialize-css": "^0.100.1", + "materialize-css": "^1.0.0", "@angular/common": "^5.0.0" }, "config": {