소스 검색

Update utils.js

valhalla-creator 1 주 전
부모
커밋
b67a236657
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      client/lib/utils.js

+ 5 - 1
client/lib/utils.js

@@ -1,6 +1,7 @@
 import { ReactiveCache } from '/imports/reactiveCache';
 
-Utils = {
+// Create Utils as a global object and export it
+export const Utils = {
   setBackgroundImage(url) {
     const currentBoard = Utils.getCurrentBoard();
     if (currentBoard.backgroundImageURL !== undefined) {
@@ -591,6 +592,9 @@ Utils = {
   },
 };
 
+// Make Utils available globally for legacy code
+window.Utils = Utils;
+
 // A simple tracker dependency that we invalidate every time the window is
 // resized. This is used to reactively re-calculate the popup position in case
 // of a window resize. This is the equivalent of a "Signal" in some other