Stop hard-coding the panel width in web/debugger.js
				
					
				
			Thanks to CSS variables we can avoid hard-coding the panel width in the JavaScript code.
This commit is contained in:
		
							parent
							
								
									22cd0c6ff8
								
							
						
					
					
						commit
						c9cd934f8a
					
				@ -13,6 +13,10 @@
 | 
				
			|||||||
 * limitations under the License.
 | 
					 * limitations under the License.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					:root {
 | 
				
			||||||
 | 
					  --panel-width: 300px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#PDFBug,
 | 
					#PDFBug,
 | 
				
			||||||
#PDFBug :is(input, button, select) {
 | 
					#PDFBug :is(input, button, select) {
 | 
				
			||||||
  font: message-box;
 | 
					  font: message-box;
 | 
				
			||||||
@ -26,7 +30,7 @@
 | 
				
			|||||||
  bottom: 0;
 | 
					  bottom: 0;
 | 
				
			||||||
  font-size: 10px;
 | 
					  font-size: 10px;
 | 
				
			||||||
  padding: 0;
 | 
					  padding: 0;
 | 
				
			||||||
  width: 300px;
 | 
					  width: var(--panel-width);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#PDFBug .controls {
 | 
					#PDFBug .controls {
 | 
				
			||||||
  background: rgba(238, 238, 238, 1);
 | 
					  background: rgba(238, 238, 238, 1);
 | 
				
			||||||
 | 
				
			|||||||
@ -492,7 +492,6 @@ const Stats = (function Stats() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Manages all the debugging tools.
 | 
					// Manages all the debugging tools.
 | 
				
			||||||
const PDFBug = (function PDFBugClosure() {
 | 
					const PDFBug = (function PDFBugClosure() {
 | 
				
			||||||
  const panelWidth = 300;
 | 
					 | 
				
			||||||
  const buttons = [];
 | 
					  const buttons = [];
 | 
				
			||||||
  let activePanel = null;
 | 
					  let activePanel = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -541,7 +540,7 @@ const PDFBug = (function PDFBugClosure() {
 | 
				
			|||||||
      ui.append(panels);
 | 
					      ui.append(panels);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      container.append(ui);
 | 
					      container.append(ui);
 | 
				
			||||||
      container.style.right = panelWidth + "px";
 | 
					      container.style.right = "var(--panel-width)";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      // Initialize all the debugging tools.
 | 
					      // Initialize all the debugging tools.
 | 
				
			||||||
      for (const tool of this.tools) {
 | 
					      for (const tool of this.tools) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user