mirror of
				https://github.com/BookStackApp/BookStack.git
				synced 2025-11-04 13:31:45 +03:00 
			
		
		
		
	Adds new options in the customization section of the settings to change the shelf, book, chapter, page, and draft colors.
		
			
				
	
	
		
			19 lines
		
	
	
		
			638 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			638 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
 | 
						|
class SettingColorPicker {
 | 
						|
 | 
						|
    constructor(elem) {
 | 
						|
        this.elem = elem;
 | 
						|
        this.colorInput = elem.querySelector('input[type=color]');
 | 
						|
        this.resetButton = elem.querySelector('[setting-color-picker-reset]');
 | 
						|
        this.defaultButton = elem.querySelector('[setting-color-picker-default]');
 | 
						|
        this.resetButton.addEventListener('click', event => {
 | 
						|
            this.colorInput.value = this.colorInput.dataset.current;
 | 
						|
        });
 | 
						|
        this.defaultButton.addEventListener('click', event => {
 | 
						|
          this.colorInput.value = this.colorInput.dataset.default;
 | 
						|
        });
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
export default SettingColorPicker;
 |