Cleanup of variable naming

This commit is contained in:
Keavon Chambers
2021-07-14 20:11:51 -07:00
parent 0656f8abc5
commit eab498f795
8 changed files with 75 additions and 58 deletions

View File

@@ -193,7 +193,7 @@
<script lang="ts">
import { defineComponent } from "vue";
import { makeModifiersBitfield } from "@/utilities/input";
import { ResponseType, registerResponseHandler, Response, UpdateCanvas, SetActiveTool, ExportDocument, SetCanvasZoom, SetRotation } from "../../utilities/response-handler";
import { ResponseType, registerResponseHandler, Response, UpdateCanvas, SetActiveTool, ExportDocument, SetCanvasZoom, SetCanvasRotation } from "../../utilities/response-handler";
import LayoutRow from "../layout/LayoutRow.vue";
import LayoutCol from "../layout/LayoutCol.vue";
import WorkingColors from "../widgets/WorkingColors.vue";
@@ -296,8 +296,8 @@ export default defineComponent({
zoomWidget.setValue(updateData.new_zoom * 100);
}
});
registerResponseHandler(ResponseType.SetRotation, (responseData: Response) => {
const updateData = responseData as SetRotation;
registerResponseHandler(ResponseType.SetCanvasRotation, (responseData: Response) => {
const updateData = responseData as SetCanvasRotation;
if (updateData) {
const rotationWidget = this.$refs.rotation as typeof NumberInput;
const newRotation = updateData.new_radians * (180 / Math.PI);

View File

@@ -150,7 +150,7 @@ import Minimap from "../panels/Minimap.vue";
import IconButton from "../widgets/buttons/IconButton.vue";
import PopoverButton, { PopoverButtonIcon } from "../widgets/buttons/PopoverButton.vue";
import { MenuDirection } from "../widgets/floating-menus/FloatingMenu.vue";
import { ResponseType, registerResponseHandler, Response, PromptConfirmationToCloseDocument } from "../../utilities/response-handler";
import { ResponseType, registerResponseHandler, Response, DisplayConfirmationToCloseDocument } from "../../utilities/response-handler";
const wasm = import("../../../wasm/pkg");
@@ -187,13 +187,11 @@ export default defineComponent({
},
mounted() {
// TODO: Move these somewhere more appropriate to act upon all panels
registerResponseHandler(ResponseType.PromptConfirmationToCloseDocument, (responseData: Response) => {
const promptData = responseData as PromptConfirmationToCloseDocument;
this.closeDocumentWithConfirmation(promptData.document_index);
registerResponseHandler(ResponseType.DisplayConfirmationToCloseDocument, (responseData: Response) => {
const data = responseData as DisplayConfirmationToCloseDocument;
this.closeDocumentWithConfirmation(data.document_index);
});
registerResponseHandler(ResponseType.PromptConfirmationToCloseAllDocuments, (_responseData: Response) => {
registerResponseHandler(ResponseType.DisplayConfirmationToCloseAllDocuments, (_responseData: Response) => {
this.closeAllDocumentsWithConfirmation();
});
},

View File

@@ -65,7 +65,6 @@ export default defineComponent({
this.documents = documentListData.open_documents;
}
});
registerResponseHandler(ResponseType.SetActiveDocument, (responseData: Response) => {
const documentData = responseData as SetActiveDocument;
if (documentData) this.activeDocument = documentData.document_index;