From ec7cb094db6e5307e11534fbf6ed97a6c4f2dfc1 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Wed, 31 Mar 2021 17:53:46 +0800 Subject: [PATCH] roojs-bootstrap.js roojs-bootstrap-debug.js --- roojs-bootstrap-debug.js | 6 ++++-- roojs-bootstrap.js | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index baa12ea5bd..11fff8495e 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -2698,11 +2698,13 @@ Roo.extend(Roo.bootstrap.Card, Roo.bootstrap.Component, { // tall image = > 1 //var w = he.dom.naturalWidth; var ww = he.width; - Roo.get(he).setX( 0 ); + he.style.left = 0; + he.style.position = 'relative'; if (hw > 1) { var nw = (ww * (1/hw)); Roo.get(he).setSize( ww * (1/hw), ww); - Roo.get(he).setX( (ww - nw)/ 2); + he.style.left = ((ww - nw)/ 2) + 'px'; + he.style.position = 'relative'; } } diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index dea8e96a4b..9830d0743d 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -111,7 +111,8 @@ this.el.removeClass('roo-card-rotated');this.el.removeClass('d-none');if(this.ro this.el.select('.roo-collapsable').removeClass('show');this.rotated=true;this.fireEvent('rotate',this,this.rotated);},dropPlaceHolder:function(A,B,C){if(this.dropEl===false){this.dropEl=Roo.DomHelper.append(this.containerEl,{cls:'d-none'},true);}this.dropEl.removeClass(['d-none','d-block']); if(A=='hide'){this.dropEl.addClass('d-none');return;}this.dropEl.dom.parentNode.removeChild(this.dropEl.dom);if(B.card!==true){var D=B.card.el.dom;if(B.position=='above'){D.parentNode.insertBefore(this.dropEl.dom,D);}else if(D.nextSibling){D.parentNode.insertBefore(this.dropEl.dom,D.nextSibling); }else{D.parentNode.append(this.dropEl.dom);}}else{this.containerEl.dom.append(this.dropEl.dom);}this.dropEl.addClass('d-block roo-card-dropzone');this.dropEl.setHeight(Roo.get(C.ddel).getHeight());},setHeaderText:function(A){this.header=A;if(this.headerContainerEl){this.headerContainerEl.dom.innerHTML=A; -}},onHeaderImageLoad:function(ev,he){if(!this.header_image_fit_square){return;}var hw=he.naturalHeight/he.naturalWidth;var ww=he.width;Roo.get(he).setX(0);if(hw>1){var nw=(ww*(1/hw));Roo.get(he).setSize(ww*(1/hw),ww);Roo.get(he).setX((ww-nw)/2);}}}); +}},onHeaderImageLoad:function(ev,he){if(!this.header_image_fit_square){return;}var hw=he.naturalHeight/he.naturalWidth;var ww=he.width;he.style.left=0;he.style.position='relative';if(hw>1){var nw=(ww*(1/hw));Roo.get(he).setSize(ww*(1/hw),ww);he.style.left=((ww-nw)/2)+'px'; +he.style.position='relative';}}}); // Roo/bootstrap/CardHeader.js Roo.bootstrap.CardHeader=function(A){Roo.bootstrap.CardHeader.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.CardHeader,Roo.bootstrap.Element,{container_method:'getCardHeader'}); // Roo/bootstrap/CardFooter.js -- 2.39.2