projects
/
roojs1
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
15a8757
)
Roo/bootstrap/Card.js
author
Alan Knowles
<alan@roojs.com>
Wed, 31 Mar 2021 09:43:50 +0000
(17:43 +0800)
committer
Alan Knowles
<alan@roojs.com>
Wed, 31 Mar 2021 09:43:50 +0000
(17:43 +0800)
Roo/bootstrap/Card.js
patch
|
blob
|
history
diff --git
a/Roo/bootstrap/Card.js
b/Roo/bootstrap/Card.js
index
2bbe1da
..
98d2bed
100644
(file)
--- a/
Roo/bootstrap/Card.js
+++ b/
Roo/bootstrap/Card.js
@@
-751,6
+751,23
@@
Roo.extend(Roo.bootstrap.Card, Roo.bootstrap.Component, {
if (this.headerContainerEl) {
this.headerContainerEl.dom.innerHTML = html;
}
+ },
+ onHeaderImageLoad : function(he)
+ {
+ if (!this.header_image_fit_square) {
+ return;
+ }
+
+ var hw = he.dom.naturalHeight / he.dom.naturalWidth;
+ // wide image = < 0
+ // tall image = > 1
+ //var w = he.dom.naturalWidth;
+ var ww = he.dom.width;
+ if (hw > 1) {
+ he.dom.width = ww * (1/hw);
+ he.dom.height = ww;
+ }
+
}