make function local
This commit is contained in:
parent
cf7a722429
commit
3958a610f9
34
main.js
34
main.js
@ -1859,7 +1859,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeColumnWidthForRouteBuildPage() {
|
function prettifyRouteBuildPage() {
|
||||||
|
function changeColumnWidth() {
|
||||||
let styles = `
|
let styles = `
|
||||||
#content table table {
|
#content table table {
|
||||||
td:nth-child(2) {
|
td:nth-child(2) {
|
||||||
@ -1886,26 +1887,29 @@
|
|||||||
addStylesToHead(styles)
|
addStylesToHead(styles)
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideDescriptionFromRouteBuildPage() {
|
function hideDescription() {
|
||||||
document.querySelectorAll(`#content > form > table > tbody > tr:is(:nth-child(3), :nth-child(6)) `).forEach(el => el.remove())
|
document.querySelectorAll(`#content > form > table > tbody > tr:is(:nth-child(3), :nth-child(6)) `).forEach(el => el.remove())
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideStartRowFromRouteBuildPage() {
|
function hideStartRow() {
|
||||||
document.querySelector(`#content table table tr:nth-child(2) `).remove()
|
document.querySelector(`#content table table tr:nth-child(2) `).remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getRows() {
|
||||||
|
return [...document.querySelectorAll(`#content > form > table > tbody > tr:nth-child(3) tr`)]
|
||||||
|
}
|
||||||
|
|
||||||
function useColspanForFinishWarning() {
|
function useColspanForFinishWarning() {
|
||||||
let rows = [...document.querySelectorAll(`#content > form > table > tbody > tr:nth-child(3) tr`)]
|
let rows = getRows()
|
||||||
let finishRow = rows.find(el => el.querySelector(`td`)?.textContent.trim() == "Финиш маршрута")
|
let finishRow = rows.find(el => el.querySelector(`td`)?.textContent.trim() == "Финиш маршрута")
|
||||||
|
|
||||||
finishRow.querySelectorAll(`td:not(:nth-child(2))`).forEach(el => el.remove())
|
finishRow.querySelectorAll(`td:not(:nth-child(2))`).forEach(el => el.remove())
|
||||||
finishRow.querySelector(`td`).colSpan = 4
|
finishRow.querySelector(`td`).colSpan = 4
|
||||||
}
|
}
|
||||||
|
|
||||||
function prettifyRouteBuildPage() {
|
changeColumnWidth()
|
||||||
changeColumnWidthForRouteBuildPage()
|
hideDescription()
|
||||||
hideDescriptionFromRouteBuildPage()
|
hideStartRow()
|
||||||
hideStartRowFromRouteBuildPage()
|
|
||||||
useColspanForFinishWarning()
|
useColspanForFinishWarning()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1924,7 +1928,8 @@
|
|||||||
document.querySelector(`${select} option:last-child`).scrollIntoView()
|
document.querySelector(`${select} option:last-child`).scrollIntoView()
|
||||||
}
|
}
|
||||||
|
|
||||||
function createPointsInpitForRouteEditPage() {
|
function prettifyRouteEditPage() {
|
||||||
|
function createPointsInpit() {
|
||||||
let addPointsContainer = document.createElement("div")
|
let addPointsContainer = document.createElement("div")
|
||||||
|
|
||||||
let pointInput = document.createElement("input")
|
let pointInput = document.createElement("input")
|
||||||
@ -2015,20 +2020,19 @@
|
|||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
||||||
function makeTextareasOneRowInRouteEditPage() {
|
function makeTextareasOneRow() {
|
||||||
document.querySelectorAll(`textarea:is([name="track[comment_int]"], [name="track[comment_ext]"])`).forEach(el => {
|
document.querySelectorAll(`textarea:is([name="track[comment_int]"], [name="track[comment_ext]"])`).forEach(el => {
|
||||||
el.rows = 1
|
el.rows = 1
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideRedundantRowsInRouteEditPage() {
|
function hideRedundantRows() {
|
||||||
document.querySelectorAll(`table tr:is(:nth-child(3), :nth-child(4), :nth-child(5))`).forEach(el => el.classList.add("hidden"))
|
document.querySelectorAll(`table tr:is(:nth-child(3), :nth-child(4), :nth-child(5))`).forEach(el => el.classList.add("hidden"))
|
||||||
}
|
}
|
||||||
|
|
||||||
function prettifyRouteEditPage() {
|
makeTextareasOneRow()
|
||||||
makeTextareasOneRowInRouteEditPage()
|
hideRedundantRows()
|
||||||
hideRedundantRowsInRouteEditPage()
|
createPointsInpit()
|
||||||
createPointsInpitForRouteEditPage()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleStagePageRows(rows) {
|
function toggleStagePageRows(rows) {
|
||||||
|
Loading…
Reference in New Issue
Block a user