Adding EnlargeMode.

Some refactor and fixes.
This commit is contained in:
2022-10-20 00:36:54 +02:00
parent 17f9668e22
commit 54e46e3d84
11 changed files with 149 additions and 33 deletions

20
src/EnlargeImages.js Normal file
View File

@ -0,0 +1,20 @@
import Preferences from "./Preferences.js";
import Styles from "./Styles.js";
export default class EnlargeImages {
static STYLES_KEY = 'midefos-idealista-enlarge-images';
static apply() {
if (Preferences.get('enlargeImages')) {
this._addEnlargeImages();
} else {
Styles.remove(this.STYLES_KEY);
}
}
static _addEnlargeImages() {
Styles.add(Styles.ENLARGE_IMAGES, this.STYLES_KEY);
}
}