Skip to content

Commit ef33fb9

Browse files
author
Gaillard
committed
v2.0.1: Event manager plugin instead extending event manager + provided inside forRoot()
1 parent 5d1ed55 commit ef33fb9

16 files changed

Lines changed: 67 additions & 68 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11

2+
<a name="2.0.1"></a>
3+
# 2.0.1 (2018-12-21)
4+
5+
* **Module import:** Service now provided inside `AngularSplitModule.forRoot()` method instead of directly in module annotation. **Warning:** Be sure to import module using `forRoot()` method otherwise it will not works anymore.
6+
* **Internal:** Now use an `EventManagerPlugin` instead of extending `EventManager` and use "as-split-undetected." template event prefix.
7+
28
<a name="2.0.0"></a>
39
# 2.0.0 (2018-12-09)
410

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# angular-split [![npm latest version](https://img.shields.io/npm/v/angular-split/latest.svg?style=flat-square)](https://www.npmjs.com/package/angular-split) [![NPM next version](https://img.shields.io/npm/v/angular-split/next.svg?style=flat-square)](https://www.npmjs.com/package/angular-split) [![Travis build](https://img.shields.io/travis/com/bertrandg/angular-split/master.svg?style=flat-square&label=Cypress+E2E+tests)](https://travis-ci.com/bertrandg/angular-split)
2-
Lightweight Angular UI library to split views and allow dragging to resize areas using CSS flexbox layout.
2+
Angular UI library to split views and allow dragging to resize areas using CSS flexbox layout.
33

44
Documentation and examples:
55
[https://bertrandg.github.io/angular-split/](https://bertrandg.github.io/angular-split/)

package-lock.json

Lines changed: 21 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

projects/angular-split/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# angular-split [![npm latest version](https://img.shields.io/npm/v/angular-split/latest.svg?style=flat-square)](https://www.npmjs.com/package/angular-split) [![NPM next version](https://img.shields.io/npm/v/angular-split/next.svg?style=flat-square)](https://www.npmjs.com/package/angular-split) [![Travis build](https://img.shields.io/travis/com/bertrandg/angular-split/master.svg?style=flat-square&label=Cypress+E2E+tests)](https://travis-ci.com/bertrandg/angular-split)
2-
Lightweight Angular UI library to split views and allow dragging to resize areas using CSS flexbox layout.
2+
Angular UI library to split views and allow dragging to resize areas using CSS flexbox layout.
33

44
Documentation and examples:
55
[https://bertrandg.github.io/angular-split/](https://bertrandg.github.io/angular-split/)

projects/angular-split/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-split",
3-
"version": "2.0.0",
4-
"description": "Lightweight Angular UI library to split views and allow dragging to resize areas using CSS flexbox layout.",
3+
"version": "2.0.1",
4+
"description": "Angular UI library to split views and allow dragging to resize areas using CSS flexbox layout.",
55
"author": "bertrandg",
66
"repository": {
77
"type": "git",

projects/angular-split/src/lib/component/split.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ import { getPointFromEvent, getPixelSize, getInputBoolean, isValidTotalSize } fr
5151
class="as-split-gutter"
5252
[style.flex-basis.px]="gutterSize"
5353
[style.order]="index*2+1"
54-
(undetected.click)="clickGutter($event, index+1)"
55-
(undetected.mousedown)="startDragging($event, index*2+1, index+1)"
56-
(undetected.touchstart)="startDragging($event, index*2+1, index+1)">
54+
(as-split-undetected.click)="clickGutter($event, index+1)"
55+
(as-split-undetected.mousedown)="startDragging($event, index*2+1, index+1)"
56+
(as-split-undetected.touchstart)="startDragging($event, index*2+1, index+1)">
5757
<div class="as-split-gutter-icon"></div>
5858
</div>
5959
</ng-template>`,

projects/angular-split/src/lib/module.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,18 @@ import { UndetectedEventPlugin } from "./service/UndetectedEventPlugin";
1717
exports: [
1818
SplitComponent,
1919
SplitAreaDirective,
20-
],
21-
providers: [
22-
{
23-
provide: EVENT_MANAGER_PLUGINS,
24-
useClass: UndetectedEventPlugin,
25-
multi: true
26-
}
2720
]
2821
})
2922
export class AngularSplitModule {
3023

3124
public static forRoot(): ModuleWithProviders {
3225
return {
3326
ngModule: AngularSplitModule,
34-
providers: []
27+
providers: [{
28+
provide: EVENT_MANAGER_PLUGINS,
29+
useClass: UndetectedEventPlugin,
30+
multi: true
31+
}]
3532
};
3633
}
3734

projects/angular-split/src/lib/service/UndetectedEventPlugin.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Injectable} from '@angular/core';
2-
import { EventManager} from '@angular/platform-browser';
1+
import { Injectable } from '@angular/core';
2+
import { EventManager } from '@angular/platform-browser';
33

44
/**
55
* Credit to Michael Strobel from:
@@ -10,13 +10,11 @@ export class UndetectedEventPlugin {
1010
manager: EventManager;
1111

1212
supports(eventName: string): boolean {
13-
console.log('SUPPROT ? eventName', eventName)
14-
return eventName.indexOf('undetected.') === 0;
13+
return eventName.indexOf('as-split-undetected.') === 0;
1514
}
1615

1716
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function {
18-
console.log('addEventListener > eventName', eventName)
19-
const realEventName = eventName.slice(11);
17+
const realEventName = eventName.slice(20);
2018

2119
return this.manager.getZone().runOutsideAngular(() => this.manager.addEventListener(element, realEventName, handler));
2220
}

projects/angular-split/src/lib/service/customEventManager.service.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

src_app/app/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const routes = [
7171
CollapseModule.forRoot(),
7272
BsDropdownModule.forRoot(),
7373
SortableModule.forRoot(),
74-
AngularSplitModule,
74+
AngularSplitModule.forRoot(),
7575
],
7676
providers: [{
7777
provide: LocationStrategy, useClass: HashLocationStrategy},

0 commit comments

Comments
 (0)