src/main/webapp/project-details.js

Tue, 03 Jan 2023 18:19:40 +0100

author
Mike Becker <universe@uap-core.de>
date
Tue, 03 Jan 2023 18:19:40 +0100
changeset 266
65c72e65ff67
parent 263
src/main/webapp/issue-editor.js@aa22103809cd
child 268
ca5501d851fa
permissions
-rw-r--r--

simplify project-details view

universe@207 1 /*
universe@266 2 * Copyright 2023 Mike Becker. All rights reserved.
universe@207 3 *
universe@207 4 * Redistribution and use in source and binary forms, with or without
universe@207 5 * modification, are permitted provided that the following conditions are met:
universe@207 6 *
universe@207 7 * 1. Redistributions of source code must retain the above copyright
universe@207 8 * notice, this list of conditions and the following disclaimer.
universe@207 9 *
universe@207 10 * 2. Redistributions in binary form must reproduce the above copyright
universe@207 11 * notice, this list of conditions and the following disclaimer in the
universe@207 12 * documentation and/or other materials provided with the distribution.
universe@207 13 *
universe@207 14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
universe@207 15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
universe@207 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
universe@207 17 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
universe@207 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
universe@207 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
universe@207 20 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
universe@207 21 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
universe@207 22 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
universe@207 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
universe@207 24 */
universe@207 25
universe@207 26 /**
universe@266 27 * Hides and shows the project details.
universe@207 28 *
universe@266 29 * Following elements are required on the page (element ID):
universe@266 30 *
universe@266 31 * - toggle-details-button
universe@266 32 * - project-details-header-reduced
universe@266 33 * - project-details-header
universe@266 34 *
universe@207 35 */
universe@266 36 projectDetailsVisible = true
universe@266 37 function toggleProjectDetails() {
universe@266 38 const button = document.getElementById('toggle-details-button')
universe@266 39 const reduced = document.getElementById('project-details-header-reduced')
universe@266 40 const full = document.getElementById('project-details-header')
universe@266 41
universe@266 42 const v = !window.projectDetailsVisible
universe@266 43 window.projectDetailsVisible = v
universe@266 44
universe@266 45 if (v) {
universe@266 46 button.dataset.toggle = 'true'
universe@266 47 reduced.style.display = 'none'
universe@266 48 full.style.display = 'block'
universe@266 49 } else {
universe@266 50 delete button.dataset.toggle
universe@266 51 reduced.style.display = 'block'
universe@266 52 full.style.display = 'none'
universe@266 53 }
universe@207 54 }
universe@266 55 window.addEventListener('load', function() { toggleProjectDetails() }, false)

mercurial