File tree Expand file tree Collapse file tree 4 files changed +32
-9
lines changed Expand file tree Collapse file tree 4 files changed +32
-9
lines changed Original file line number Diff line number Diff line change @@ -551,14 +551,22 @@ span.sp-thumb-el {
551
551
.collapse-left , .collapse-right {
552
552
position : absolute;
553
553
left : 5px ;
554
- bottom : -5 px ;
554
+ bottom : -9 px ;
555
555
cursor : pointer;
556
- width : 15px ;
557
- height : 15px ;
556
+ width : 17px ;
557
+ height : 17px ;
558
+ border-radius : 5px ;
559
+ background : url ('images/expand.png' ) no-repeat scroll center center # fff ;
560
+ background-size : 100% ;
558
561
}
559
562
.collapse-right {
563
+ bottom : -2px ;
560
564
background : url ('images/expand.png' ) no-repeat scroll center center # fff ;
561
565
}
566
+ /* rotate the V down arrow to point up */
567
+ .arrowsUp {
568
+ transform : rotate (180deg );
569
+ }
562
570
}
563
571
564
572
.viewer {
@@ -650,6 +658,7 @@ span.sp-thumb-el {
650
658
width : 80px ;
651
659
height : 80px ;
652
660
margin : 5px ;
661
+ flex : auto 0 0 ;
653
662
}
654
663
thumbnail-slider img {
655
664
margin : 0 ;
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ <h4 class="modal-title">Confirmation</h4>
63
63
</ thumbnail-slider >
64
64
65
65
< div class ="col-splitter left-split ">
66
- < div class ="collapse-left "> </ div >
66
+ < div class ="collapse-left arrowsUp "> </ div >
67
67
</ div >
68
68
69
69
< div class ="frame col-xs-12 "
Original file line number Diff line number Diff line change @@ -410,14 +410,19 @@ export default class ThumbnailSlider extends EventSubscriber {
410
410
* @memberof ThumbnailSlider
411
411
*/
412
412
loadVisibleThumbnails ( scrollTop , init = false , refresh = false ) {
413
+ const panel = document . querySelector ( '.thumbnail-scroll-panel' ) ;
413
414
if ( scrollTop === undefined ) {
414
- const panel = document . querySelector ( '.thumbnail-scroll- panel' ) ;
415
- if ( panel )
416
- scrollTop = panel . scrollTop ;
415
+ if ( panel ) {
416
+ scrollTop = panel . scrollTop ;
417
+ }
417
418
}
419
+ // handle horizontal scrolling (mobile layout) or vertical scrolling (desktop layout)
420
+ let slider_width = document . querySelector ( '.thumbnail-scroll-panel' ) . clientWidth ;
421
+ let sliderSize = Math . max ( slider_width , this . slider_height ) ;
422
+ let scrollStart = Math . max ( scrollTop , panel . scrollLeft ) ;
418
423
419
- let thumb_start_index = parseInt ( scrollTop / this . thumbnail_size ) ;
420
- let thumb_end_index = parseInt ( ( scrollTop + this . slider_height ) / this . thumbnail_size ) ;
424
+ let thumb_start_index = parseInt ( scrollStart / this . thumbnail_size ) ;
425
+ let thumb_end_index = parseInt ( ( scrollStart + sliderSize ) / this . thumbnail_size ) ;
421
426
422
427
let unloaded = [ ] ;
423
428
for ( var idx = thumb_start_index ; idx <= thumb_end_index ; idx ++ ) {
Original file line number Diff line number Diff line change @@ -123,6 +123,7 @@ export default class Ui {
123
123
static collapseSidePanel ( eventbus , leftSplit ) {
124
124
125
125
let el = leftSplit ? $ ( '.thumbnail-panel' ) : $ ( '.right-hand-panel' ) ;
126
+ let handle = leftSplit ? $ ( '.collapse-left' ) : $ ( '.collapse-right' ) ;
126
127
127
128
let width = parseInt ( el . css ( '--panelWidth' ) ) ;
128
129
let height = parseInt ( el . css ( '--panelHeight' ) ) ;
@@ -141,6 +142,14 @@ export default class Ui {
141
142
// update css - the appropriate width/height var will be used depending on layout
142
143
el . css ( '--panelHeight' , newHeight + "px" ) ;
143
144
el . css ( '--panelWidth' , newWidth + "px" ) ;
145
+ // class used to set the collapse-handle icon
146
+ if ( leftSplit ) {
147
+ if ( newHeight > 0 ) { handle . addClass ( "arrowsUp" ) ; }
148
+ else { handle . removeClass ( "arrowsUp" ) ; }
149
+ } else {
150
+ if ( newHeight == 0 ) { handle . addClass ( "arrowsUp" ) ; }
151
+ else { handle . removeClass ( "arrowsUp" ) ; }
152
+ }
144
153
eventbus . publish ( IMAGE_VIEWER_RESIZE , { config_id : - 1 } ) ;
145
154
}
146
155
You can’t perform that action at this time.
0 commit comments