Skip to content

Commit

Permalink
Added constants for style events.
Browse files Browse the repository at this point in the history
  • Loading branch information
azaslonov committed Sep 16, 2023
1 parent 1f9fe53 commit de8932b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/events/commonEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export enum Events {
ContentUpdate = "onContentChange",
ViewportChange = "onViewportChange",
StyleChange = "onStyleChange",
StyleRemove = "onStyleRemove",
MouseUp = "mouseup",
MouseDown = "mousedown",
MouseEnter = "mouseenter",
Expand Down
6 changes: 3 additions & 3 deletions src/styles/styleManager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Bag } from "..";
import { StyleSheet } from "../styles";
import { EventManager } from "../events";
import { EventManager, Events } from "../events";


export class StyleManager {
Expand All @@ -14,7 +14,7 @@ export class StyleManager {
this.styleSheets[styleSheet.key] = styleSheet;

if (this.eventManager) {
this.eventManager.dispatchEvent("onStyleChange", styleSheet);
this.eventManager.dispatchEvent(Events.StyleChange, styleSheet);
}
}

Expand All @@ -28,7 +28,7 @@ export class StyleManager {

public removeStyleSheet(styleSheet: StyleSheet): void {
if (this.eventManager) {
this.eventManager.dispatchEvent("onStyleRemove", styleSheet.key);
this.eventManager.dispatchEvent(Events.StyleRemove, styleSheet.key);
}
}

Expand Down

0 comments on commit de8932b

Please sign in to comment.