mirror of
https://github.com/wallabag/wallabag.git
synced 2025-07-22 17:18:37 +00:00
Extract Config controller
This commit is contained in:
parent
9da9e6b004
commit
a06da68e72
5 changed files with 24 additions and 58 deletions
16
assets/controllers/config_controller.js
Normal file
16
assets/controllers/config_controller.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
import { Controller } from '@hotwired/stimulus';
|
||||
|
||||
export default class extends Controller {
|
||||
static targets = ['previewArticle', 'previewContent', 'font', 'fontSize', 'lineHeight', 'maxWidth'];
|
||||
|
||||
connect() {
|
||||
this.updatePreview();
|
||||
}
|
||||
|
||||
updatePreview() {
|
||||
this.previewArticleTarget.style.maxWidth = `${this.maxWidthTarget.value}em`;
|
||||
this.previewContentTarget.style.fontFamily = this.fontTarget.value;
|
||||
this.previewContentTarget.style.fontSize = `${this.fontSizeTarget.value}em`;
|
||||
this.previewContentTarget.style.lineHeight = `${this.lineHeightTarget.value}em`;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue