refactoring
parent
062c210674
commit
055768c626
|
|
@ -369,7 +369,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
document.querySelector("#button--addLotType").addEventListener("click", () => {
|
||||
let addCloseModalFunction;
|
||||
const doAdd = (submitEvent) => {
|
||||
function doAdd(submitEvent) {
|
||||
submitEvent.preventDefault();
|
||||
cityssm.postJSON(los.urlPrefix + "/admin/doAddLotType", submitEvent.currentTarget, (responseJSON) => {
|
||||
if (responseJSON.success) {
|
||||
|
|
@ -385,7 +385,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
cityssm.openHtmlModal("adminLotTypes-addLotType", {
|
||||
onshow(modalElement) {
|
||||
los.populateAliases(modalElement);
|
||||
|
|
|
|||
|
|
@ -632,12 +632,12 @@ declare const bulmaJS: BulmaJS;
|
|||
}
|
||||
}
|
||||
|
||||
(document.querySelector("#button--addLotType") as HTMLButtonElement).addEventListener(
|
||||
document.querySelector("#button--addLotType")!.addEventListener(
|
||||
"click",
|
||||
() => {
|
||||
let addCloseModalFunction: () => void;
|
||||
|
||||
const doAdd = (submitEvent: SubmitEvent) => {
|
||||
function doAdd(submitEvent: SubmitEvent): void {
|
||||
submitEvent.preventDefault();
|
||||
|
||||
cityssm.postJSON(
|
||||
|
|
@ -661,7 +661,7 @@ declare const bulmaJS: BulmaJS;
|
|||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
cityssm.openHtmlModal("adminLotTypes-addLotType", {
|
||||
onshow(modalElement) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const workOrderTypeIdsElement = document.querySelector("#icsFilters--workOrderTypeIds");
|
||||
const workOrderMilestoneTypeIdsElement = document.querySelector("#icsFilters--workOrderMilestoneTypeIds");
|
||||
const calendarLinkElement = document.querySelector("#icsFilters--calendarURL");
|
||||
const updateCalendarURL = () => {
|
||||
function updateCalendarURL() {
|
||||
let url = window.location.href.slice(0, Math.max(0, window.location.href.indexOf(window.location.pathname) + 1)) +
|
||||
los.urlPrefix +
|
||||
"api/" +
|
||||
|
|
@ -31,7 +31,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
url = url.slice(0, -1) + "&";
|
||||
}
|
||||
calendarLinkElement.value = url.slice(0, -1);
|
||||
};
|
||||
}
|
||||
document.querySelector("#icsFilters--workOrderTypeIds-all").addEventListener("change", (changeEvent) => {
|
||||
workOrderTypeIdsElement.disabled = changeEvent.currentTarget.checked;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -17,12 +17,11 @@ import type * as globalTypes from "../types/globalTypes";
|
|||
"#icsFilters--calendarURL"
|
||||
) as HTMLTextAreaElement;
|
||||
|
||||
const updateCalendarURL = () => {
|
||||
let url =
|
||||
window.location.href.slice(
|
||||
0,
|
||||
Math.max(0, window.location.href.indexOf(window.location.pathname) + 1)
|
||||
) +
|
||||
function updateCalendarURL() {
|
||||
let url = window.location.href.slice(
|
||||
0,
|
||||
Math.max(0, window.location.href.indexOf(window.location.pathname) + 1)
|
||||
) +
|
||||
los.urlPrefix +
|
||||
"api/" +
|
||||
los.apiKey +
|
||||
|
|
@ -30,10 +29,8 @@ import type * as globalTypes from "../types/globalTypes";
|
|||
"milestoneICS/" +
|
||||
"?";
|
||||
|
||||
if (
|
||||
!workOrderTypeIdsElement.disabled &&
|
||||
workOrderTypeIdsElement.selectedOptions.length > 0
|
||||
) {
|
||||
if (!workOrderTypeIdsElement.disabled &&
|
||||
workOrderTypeIdsElement.selectedOptions.length > 0) {
|
||||
url += "workOrderTypeIds=";
|
||||
|
||||
for (const optionElement of workOrderTypeIdsElement.selectedOptions) {
|
||||
|
|
@ -43,10 +40,8 @@ import type * as globalTypes from "../types/globalTypes";
|
|||
url = url.slice(0, -1) + "&";
|
||||
}
|
||||
|
||||
if (
|
||||
!workOrderMilestoneTypeIdsElement.disabled &&
|
||||
workOrderMilestoneTypeIdsElement.selectedOptions.length > 0
|
||||
) {
|
||||
if (!workOrderMilestoneTypeIdsElement.disabled &&
|
||||
workOrderMilestoneTypeIdsElement.selectedOptions.length > 0) {
|
||||
url += "workOrderMilestoneTypeIds=";
|
||||
|
||||
for (const optionElement of workOrderMilestoneTypeIdsElement.selectedOptions) {
|
||||
|
|
@ -57,7 +52,7 @@ import type * as globalTypes from "../types/globalTypes";
|
|||
}
|
||||
|
||||
calendarLinkElement.value = url.slice(0, -1);
|
||||
};
|
||||
}
|
||||
|
||||
(
|
||||
document.querySelector("#icsFilters--workOrderTypeIds-all") as HTMLInputElement
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,t=document.querySelector("#icsFilters--workOrderTypeIds"),r=document.querySelector("#icsFilters--workOrderMilestoneTypeIds"),s=document.querySelector("#icsFilters--calendarURL"),l=()=>{let l=window.location.href.slice(0,Math.max(0,window.location.href.indexOf(window.location.pathname)+1))+e.urlPrefix+"api/"+e.apiKey+"/milestoneICS/?";if(!t.disabled&&t.selectedOptions.length>0){l+="workOrderTypeIds=";for(const e of t.selectedOptions)l+=e.value+",";l=l.slice(0,-1)+"&"}if(!r.disabled&&r.selectedOptions.length>0){l+="workOrderMilestoneTypeIds=";for(const e of r.selectedOptions)l+=e.value+",";l=l.slice(0,-1)+"&"}s.value=l.slice(0,-1)};document.querySelector("#icsFilters--workOrderTypeIds-all").addEventListener("change",e=>{t.disabled=e.currentTarget.checked}),document.querySelector("#icsFilters--workOrderMilestoneTypeIds-all").addEventListener("change",e=>{r.disabled=e.currentTarget.checked});const o=document.querySelector("#panel--icsFilters").querySelectorAll("input, select");for(const e of o)e.addEventListener("change",l);l(),s.addEventListener("click",()=>{s.focus(),s.select()})})();
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,t=document.querySelector("#icsFilters--workOrderTypeIds"),r=document.querySelector("#icsFilters--workOrderMilestoneTypeIds"),s=document.querySelector("#icsFilters--calendarURL");function o(){let o=window.location.href.slice(0,Math.max(0,window.location.href.indexOf(window.location.pathname)+1))+e.urlPrefix+"api/"+e.apiKey+"/milestoneICS/?";if(!t.disabled&&t.selectedOptions.length>0){o+="workOrderTypeIds=";for(const e of t.selectedOptions)o+=e.value+",";o=o.slice(0,-1)+"&"}if(!r.disabled&&r.selectedOptions.length>0){o+="workOrderMilestoneTypeIds=";for(const e of r.selectedOptions)o+=e.value+",";o=o.slice(0,-1)+"&"}s.value=o.slice(0,-1)}document.querySelector("#icsFilters--workOrderTypeIds-all").addEventListener("change",e=>{t.disabled=e.currentTarget.checked}),document.querySelector("#icsFilters--workOrderMilestoneTypeIds-all").addEventListener("change",e=>{r.disabled=e.currentTarget.checked});const c=document.querySelector("#panel--icsFilters").querySelectorAll("input, select");for(const e of c)e.addEventListener("change",o);o(),s.addEventListener("click",()=>{s.focus(),s.select()})})();
|
||||
Loading…
Reference in New Issue