فهرست منبع

refactor: Remove some hard-coding in the MathJax subtype.

Daniel J. Geiger 1 سال پیش
والد
کامیت
5164bdb782
1فایلهای تغییر یافته به همراه5 افزوده شده و 5 حذف شده
  1. 5 5
      src/element/subtypes/mathjax/implementation.tsx

+ 5 - 5
src/element/subtypes/mathjax/implementation.tsx

@@ -26,7 +26,7 @@ import Scene from "../../../scene/Scene";
 
 
 // Imports for actions
 // Imports for actions
 import { t, registerAuxLangData } from "../../../i18n";
 import { t, registerAuxLangData } from "../../../i18n";
-import { Action } from "../../../actions/types";
+import { Action, makeCustomActionName } from "../../../actions/types";
 import { AppState } from "../../../types";
 import { AppState } from "../../../types";
 import {
 import {
   changeProperty,
   changeProperty,
@@ -1395,7 +1395,7 @@ const enableActionChangeMathProps = (
 const createMathActions = () => {
 const createMathActions = () => {
   const mathActions: Action[] = [];
   const mathActions: Action[] = [];
   const actionUseTexTrue: Action = {
   const actionUseTexTrue: Action = {
-    name: "custom.useTexTrue",
+    name: makeCustomActionName("useTexTrue"),
     perform: (elements, appState) => {
     perform: (elements, appState) => {
       const mathOnly = getMathProps.getMathOnly(appState);
       const mathOnly = getMathProps.getMathOnly(appState);
       const customData = appState.customData ?? {};
       const customData = appState.customData ?? {};
@@ -1414,7 +1414,7 @@ const createMathActions = () => {
     trackEvent: false,
     trackEvent: false,
   };
   };
   const actionUseTexFalse: Action = {
   const actionUseTexFalse: Action = {
-    name: "custom.useTexFalse",
+    name: makeCustomActionName("useTexFalse"),
     perform: (elements, appState) => {
     perform: (elements, appState) => {
       const mathOnly = getMathProps.getMathOnly(appState);
       const mathOnly = getMathProps.getMathOnly(appState);
       const customData = appState.customData ?? {};
       const customData = appState.customData ?? {};
@@ -1433,7 +1433,7 @@ const createMathActions = () => {
     trackEvent: false,
     trackEvent: false,
   };
   };
   const actionResetUseTex: Action = {
   const actionResetUseTex: Action = {
-    name: "custom.resetUseTex",
+    name: makeCustomActionName("resetUseTex"),
     perform: (elements, appState) => {
     perform: (elements, appState) => {
       const useTex = getMathProps.getUseTex(appState);
       const useTex = getMathProps.getUseTex(appState);
       const modElements = changeProperty(
       const modElements = changeProperty(
@@ -1481,7 +1481,7 @@ const createMathActions = () => {
     trackEvent: false,
     trackEvent: false,
   };
   };
   const actionChangeMathOnly: Action = {
   const actionChangeMathOnly: Action = {
-    name: "custom.changeMathOnly",
+    name: makeCustomActionName("changeMathOnly"),
     perform: (elements, appState, mathOnly: boolean | null) => {
     perform: (elements, appState, mathOnly: boolean | null) => {
       if (mathOnly === null) {
       if (mathOnly === null) {
         mathOnly = getFormValue(
         mathOnly = getFormValue(