Mercurial > hg > mgallery
comparison mgallery.js @ 209:671b7cfebf87
Various fixes and adjustments to style.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 22 Mar 2018 13:41:36 +0200 |
parents | cdccda315a0f |
children | 0a0a2936d779 |
comparison
equal
deleted
inserted
replaced
208:cdccda315a0f | 209:671b7cfebf87 |
---|---|
114 | 114 |
115 | 115 |
116 function mgalAdjustImageDo() | 116 function mgalAdjustImageDo() |
117 { | 117 { |
118 var eimg = document.getElementById("imageImage"); | 118 var eimg = document.getElementById("imageImage"); |
119 var win = mgalGetElementOrWindowSize(); | 119 var win = mgalGetElementOrWindowSize("pageImageBox"); |
120 var madj = 0.90; | 120 var madj = 0.99; |
121 if (eimg && win != null) | 121 if (eimg && win != null) |
122 { | 122 { |
123 if (eimg.width > eimg.height) | 123 if (eimg.width > eimg.height) |
124 { | 124 { |
125 eimg.style.width = "100%"; | 125 eimg.style.width = "100%"; |
131 } | 131 } |
132 } | 132 } |
133 else | 133 else |
134 { | 134 { |
135 eimg.style.width = "auto"; | 135 eimg.style.width = "auto"; |
136 eimg.style.height = "100%"; | |
136 if (eimg.height > win[1] * madj) | 137 if (eimg.height > win[1] * madj) |
137 eimg.style.height = (win[1] * madj)+"px"; | 138 eimg.style.height = (win[1] * madj)+"px"; |
138 else | |
139 eimg.style.height = "100%"; | |
140 } | 139 } |
141 } | 140 } |
142 adjustPID = -1; | 141 adjustPID = -1; |
143 } | 142 } |
144 | 143 |