projects
/
roojs1
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5344d97
)
use scrollheight , and resize
author
Alan Knowles
<alan@roojs.com>
Tue, 9 Feb 2021 08:57:51 +0000
(16:57 +0800)
committer
Alan Knowles
<alan@roojs.com>
Tue, 9 Feb 2021 08:57:51 +0000
(16:57 +0800)
ux/Lightbox.js
patch
|
blob
|
history
diff --git
a/ux/Lightbox.js
b/ux/Lightbox.js
index
a1b7551
..
456aeb5
100644
(file)
--- a/
ux/Lightbox.js
+++ b/
ux/Lightbox.js
@@
-357,8
+357,12
@@
Roo.apply(Roo.ux.Lightbox.prototype,
// stretch overlay to fill page and fade in
//var arrayPageSize = this.getPageSize();
// stretch overlay to fill page and fade in
//var arrayPageSize = this.getPageSize();
- this.overlay.setHeight(Roo.lib.Dom.getDocumentHeight()) ;
- this.overlay.setWidth(Roo.lib.Dom.getDocumentWidth());
+ this.onResize();
+ if (!this.resizer) {
+ this.resizer = Roo.EventManager.onWindowResize(this.onResize, this, true);;
+ }
+
+
this.overlay.fadeIn({
endOpacity: this.overlayOpacity,
easing: 'easeOut',
this.overlay.fadeIn({
endOpacity: this.overlayOpacity,
easing: 'easeOut',
@@
-378,7
+382,7
@@
Roo.apply(Roo.ux.Lightbox.prototype,
}
});
}
}
});
}
-
+
// let's assume the constructor sorts out the list of images..
/*
if ((imageLink.rel == 'lightbox')){
// let's assume the constructor sorts out the list of images..
/*
if ((imageLink.rel == 'lightbox')){
@@
-399,7
+403,7
@@
Roo.apply(Roo.ux.Lightbox.prototype,
// weird.. why / 10?
//var lightboxTop = s.top + (Roo.lib.Dom.getViewHeight() / 10);
// weird.. why / 10?
//var lightboxTop = s.top + (Roo.lib.Dom.getViewHeight() / 10);
- var lightboxTop = (Roo.lib.Dom.getViewHeight() / 10);
+ var lightboxTop = (Roo.lib.Dom.getViewHeight() / 10)
+ document.body.scrollTop
;
var lightboxLeft = s.left;
this.lightbox.setStyle({
top: lightboxTop + 'px',
var lightboxLeft = s.left;
this.lightbox.setStyle({
top: lightboxTop + 'px',
@@
-413,6
+417,11
@@
Roo.apply(Roo.ux.Lightbox.prototype,
this.changeImage(imageNum);
},
this.changeImage(imageNum);
},
+ onResize : function()
+ {
+ this.overlay.setHeight(Roo.lib.Dom.getDocumentHeight()) ;
+ this.overlay.setWidth(Roo.lib.Dom.getDocumentWidth());
+ },
//
// changeImage()
// Hide most elements and preload image in preparation for resizing image container.
//
// changeImage()
// Hide most elements and preload image in preparation for resizing image container.