{
this.disabled = false;
this.el.removeClass('disabled');
+ this.el.dom.removeAttribute("disabled");
},
/**
{
this.disabled = true;
this.el.addClass('disabled');
+ this.el.attr("disabled", "disabled")
},
/**
* sets the active state on/off,
bodyEl: false, // card-body
headerContainerEl : false, //
headerEl : false,
+ header_imageEl : false,
layoutCls : function()
{
},
getCardImageTop : function()
{
- var ret = this.el.select('.card-img-top',true).first();
+ var ret = this.header_imageEl;
if (ret.hasClass('d-none')) {
ret.removeClass('d-none');
}
this.el.addClass('roo-card-rotated');
this.fireEvent('rotate', this, true);
}
+ this.header_imageEl = this.el.select('.card-img-top',true).first();
+ this.header_imageEl.on('load', this.onHeaderImageLoad, this );
},
getDragData : function(e)
if (this.headerContainerEl) {
this.headerContainerEl.dom.innerHTML = html;
}
+ },
+ onHeaderImageLoad : function(ev, he)
+ {
+ if (!this.header_image_fit_square) {
+ return;
+ }
+
+ var hw = he.naturalHeight / he.naturalWidth;
+ // wide image = < 0
+ // tall image = > 1
+ //var w = he.dom.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';
+ }
+
}