Skip to content

TagSpaces is an offline, open source, document manager with tagging support

adding flexbox layout the image gallery

uggrock5e6611e3c45d
diff --git a/data/ext/perspectiveImageSwiper/gallery.css b/data/ext/perspectiveImageSwiper/gallery.css
index 4553bd42e..a16a42736 100644
--- a/data/ext/perspectiveImageSwiper/gallery.css
+++ b/data/ext/perspectiveImageSwiper/gallery.css
@@ -1,16 +1,27 @@
.my-gallery {
width: 100%;
float: left;
+
+ display: flex;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+
+ flex-wrap: wrap;
}
.my-gallery img {
width: 100%;
height: auto;
+ max-width: 300px;
}
.my-gallery figure {
display: block;
float: left;
margin: 0 5px 5px 0;
width: 150px;
+
+ flex: 1 1 auto;
+ -webkit-flex: 1 1 auto;
+ -ms-flex: 1 1 auto;
}
.my-gallery figcaption {
display: none;
diff --git a/data/ext/perspectiveImageSwiper/galleryTMPL.html b/data/ext/perspectiveImageSwiper/galleryTMPL.html
index afd30eeb8..b8a449679 100644
--- a/data/ext/perspectiveImageSwiper/galleryTMPL.html
+++ b/data/ext/perspectiveImageSwiper/galleryTMPL.html
@@ -1,32 +1,22 @@
-
-
<div>
<h4></h4>
<div class="my-gallery" itemscope itemtype="http://schema.org/ImageGallery">
-
{{#each data}}
- <figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
- <a href={{path}} itemprop="contentUrl">
- <img src={{thumbnail}} itemprop="thumbnail" alt={{name}}/>
- </a>
- <figcaption itemprop="caption description">{{name}}</figcaption>
- </figure>
+ <figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
+ <a href={{path}} itemprop="contentUrl">
+ <img src={{thumbnail}} itemprop="thumbnail" alt={{name}}/>
+ </a>
+ <figcaption itemprop="caption description">{{name}}</figcaption>
+ </figure>
{{/each}}
-
</div>
</div>
-
-
-<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
-
- <!-- Background of PhotoSwipe.
+ <!-- Background of PhotoSwipe.
It's a separate element, as animating opacity is faster than rgba(). -->
<div class="pswp__bg"></div>
-
<!-- Slides wrapper with overflow:hidden. -->
<div class="pswp__scroll-wrap">
-
<!-- Container that holds slides. PhotoSwipe keeps only 3 slides in DOM to save memory. -->
<!-- don't modify these 3 pswp__item elements, data is added later on. -->
<div class="pswp__container">
@@ -34,24 +24,15 @@
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
-
<!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
<div class="pswp__ui pswp__ui--hidden">
-
<div class="pswp__top-bar">
-
<!-- Controls are self-explanatory. Order can be changed. -->
-
<div class="pswp__counter"></div>
-
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
-
<button class="pswp__button pswp__button--share" title="Share"></button>
-
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
-
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
-
<!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
<!-- element will get class pswp__preloader--active when preloader is running -->
<div class="pswp__preloader">
@@ -62,23 +43,14 @@
</div>
</div>
</div>
-
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
- <div class="pswp__share-tooltip"></div>
+ <div class="pswp__share-tooltip"></div>
</div>
-
- <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
- </button>
-
- <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
- </button>
-
+ <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)"></button>
+ <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)"></button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
-
- </div>
-
</div>
-
+ </div>
</div>
\ No newline at end of file