summaryrefslogtreecommitdiff
path: root/searx/static/themes/__common__
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-10-28 08:50:55 +0200
committerGitHub <noreply@github.com>2021-10-28 08:50:55 +0200
commit8985d3e6ef3c1371b21bee69074f0e38acae9967 (patch)
tree0dd6787e3b6176345e681c02746177e626f0ac19 /searx/static/themes/__common__
parent2624034cd6f417b52ed3f9f3f5226720fa0b53a1 (diff)
parenta93bd191012add3adb670ecbc6e4119feb59ab02 (diff)
Merge pull request #376 from dalf/simple-image-detail
Simple theme: image detail
Diffstat (limited to 'searx/static/themes/__common__')
-rw-r--r--searx/static/themes/__common__/js/image_layout.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/searx/static/themes/__common__/js/image_layout.js b/searx/static/themes/__common__/js/image_layout.js
index fa96f62c5..653da95a0 100644
--- a/searx/static/themes/__common__/js/image_layout.js
+++ b/searx/static/themes/__common__/js/image_layout.js
@@ -11,11 +11,12 @@
*/
(function (w, d) {
- function ImageLayout(container_selector, results_selector, img_selector, margin, maxHeight) {
+ function ImageLayout(container_selector, results_selector, img_selector, verticalMargin, horizontalMargin, maxHeight) {
this.container_selector = container_selector;
this.results_selector = results_selector;
this.img_selector = img_selector;
- this.margin = margin;
+ this.verticalMargin = verticalMargin;
+ this.horizontalMargin = horizontalMargin;
this.maxHeight = maxHeight;
this.isAlignDone = true;
}
@@ -45,7 +46,7 @@
}
}
- return (width - images.length * this.margin) / r; //have to round down because Firefox will automatically roundup value with number of decimals > 3
+ return (width - images.length * this.verticalMargin) / r; //have to round down because Firefox will automatically roundup value with number of decimals > 3
};
ImageLayout.prototype._setSize = function (images, height) {
@@ -62,10 +63,10 @@
}
img.style.width = imgWidth + 'px';
img.style.height = height + 'px';
- img.style.marginLeft = '3px';
- img.style.marginTop = '3px';
- img.style.marginRight = this.margin - 7 + 'px'; // -4 is the negative margin of the inline element
- img.style.marginBottom = this.margin - 7 + 'px';
+ img.style.marginLeft = this.horizontalMargin + 'px';
+ img.style.marginTop = this.horizontalMargin + 'px';
+ img.style.marginRight = this.verticalMargin - 7 + 'px'; // -4 is the negative margin of the inline element
+ img.style.marginBottom = this.verticalMargin - 7 + 'px';
resultNode = img.parentNode.parentNode;
if (!resultNode.classList.contains('js')) {
resultNode.classList.add('js');