|
27 | 27 | visibility:visible; |
28 | 28 | } |
29 | 29 | .modal-wrap.modal-container { |
30 | | -box-shadow:0002pxvar(--page-background); |
| 30 | +box-shadow:5px5px10px0pxrgba(0,0,0,0.5); |
31 | 31 | color:var(--base-6); |
32 | 32 | margin:1em; |
33 | 33 | max-width:94%; |
|
120 | 120 | </div> |
121 | 121 |
|
122 | 122 | <script> |
| 123 | +(function() { |
123 | 124 | let configOptions=document.querySelectorAll('.config-option'); |
124 | 125 | let oppositeValues= {'light':'dark','dark':'light','normal':'full','full':'normal' }; |
125 | 126 | [...configOptions].forEach(option=> { |
|
134 | 135 | }); |
135 | 136 | }); |
136 | 137 |
|
137 | | -letopenModal=document.getElementById('open-settings'); |
138 | | -letmodal=document.getElementById('profiler-settings'); |
| 138 | +letopenModalButton=document.getElementById('open-settings'); |
| 139 | +letmodalWindow=document.getElementById('profiler-settings'); |
139 | 140 | let closeModalButton=document.getElementsByClassName('close-modal')[0]; |
140 | 141 | let modalWrapper=document.getElementsByClassName('modal-wrap')[0] |
141 | 142 |
|
142 | | -openModal.addEventListener('click',function(event) { |
143 | | -if ('theme-light'==localStorage.getItem('symfony/profiler/theme')) { |
144 | | -document.getElementById('settings-theme-light').checked='checked'; |
145 | | - }else { |
146 | | -document.getElementById('settings-theme-dark').checked='checked'; |
147 | | - } |
148 | | -
|
149 | | -if ('width-normal'==localStorage.getItem('symfony/profiler/width')) { |
150 | | -document.getElementById('settings-width-normal').checked='checked'; |
151 | | - }else { |
152 | | -document.getElementById('settings-width-full').checked='checked'; |
153 | | - } |
| 143 | +openModalButton.addEventListener('click',function(event) { |
| 144 | +document.getElementById('settings-'+localStorage.getItem('symfony/profiler/theme')).checked='checked'; |
| 145 | +document.getElementById('settings-'+localStorage.getItem('symfony/profiler/width')).checked='checked'; |
154 | 146 |
|
155 | | -modal.classList.toggle('visible'); |
| 147 | +modalWindow.classList.toggle('visible'); |
156 | 148 | event.preventDefault(); |
157 | 149 | }); |
158 | 150 |
|
159 | 151 | closeModalButton.addEventListener('click',function() { |
160 | | -modal.classList.remove('visible'); |
| 152 | +modalWindow.classList.remove('visible'); |
161 | 153 | }); |
162 | 154 | modalWrapper.addEventListener('click',function(event) { |
163 | 155 | if (event.target==event.currentTarget) { |
164 | | -modal.classList.remove('visible'); |
| 156 | +modalWindow.classList.remove('visible'); |
165 | 157 | } |
166 | 158 | }); |
| 159 | +})(); |
167 | 160 | </script> |