Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Commit

Permalink
feat(ripple): Add new DocumentInteractionHandler APIs
Browse files Browse the repository at this point in the history
Closes #440 Closes #513
  • Loading branch information
trimox committed Jan 10, 2018
1 parent 3f3b67b commit 66e71dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/ripple/adapter.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export interface MDCRippleAdapter {
removeClass: (className: string) => void;
registerInteractionHandler: (evtType: string, handler: EventListener) => void;
deregisterInteractionHandler: (evtType: string, handler: EventListener) => void;
registerDocumentInteractionHandler: (evtType: string, handler: EventListener) => void;
deregisterDocumentInteractionHandler: (evtType: string, handler: EventListener) => void;
registerResizeHandler: (handler: EventListener) => void;
deregisterResizeHandler: (handler: EventListener) => void;
updateCssVariable: (varName: string, value: string) => void;
Expand Down
6 changes: 6 additions & 0 deletions src/lib/ripple/ripple.orchestration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ export abstract class MdcRippleOrchestration {
deregisterInteractionHandler: (evtType: string, handler: EventListener) => {
this._registry.unlisten(evtType, handler);
},
registerDocumentInteractionHandler: (evtType, handler) => {
this._registry.listen(evtType, handler, document, util.applyPassive())
},
deregisterDocumentInteractionHandler: (evtType, handler) => {
this._registry.unlisten(evtType, handler)
},
registerResizeHandler: (handler: EventListener) => {
if (isBrowser()) {
this._registry.listen('resize', handler, window);
Expand Down

0 comments on commit 66e71dc

Please sign in to comment.