Skip to content

Commit

Permalink
fix: <add completed handler into handleElement>
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake.Zheng authored and Jake.Zheng committed Sep 18, 2018
1 parent 84a0c3a commit 9e9fde4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/uku.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/uku.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/core/IUkulele.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface IUkulele extends IEventEmitter{

init();

handleElement(element);
handleElement(element, handleElementCompletedFunc);

registerController(instanceName, controllerInst);

Expand Down
5 changes: 4 additions & 1 deletion src/core/Ukulele.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ export let Ukulele = class Ukulele extends EventEmitter implements IUkulele {
});
}

public handleElement(element: HTMLElement): void {
public handleElement(element: HTMLElement, handleElementCompletedFunc: Function): void {
this.analyizeElement(element, (e) => {
this.dispatchEvent(new Event(UkuEventType.HANDLE_ELEMENT_COMPLETED, e));
if(handleElementCompletedFunc && typeof handleElementCompletedFunc === 'function'){
handleElementCompletedFunc(e.element);
}
});
}

Expand Down

0 comments on commit 9e9fde4

Please sign in to comment.