name: false,
target: false,
- pressed : false,
+ pressed : null,
getAutoCreate : function(){
return;
}
-
Roo.log('button on click ');
if(this.preventDefault){
e.preventDefault();
}
if (this.pressed === true || this.pressed === false) {
- this.pressed = !this.pressed;
- this.el[this.pressed ? 'addClass' : 'removeClass']('active');
- this.fireEvent('toggle', this, e, this.pressed);
+ this.toggleActive(e);
}
/**
* toggles the current active state
*/
- toggleActive : function()
+ toggleActive : function(e)
{
- var active = this.el.hasClass('active');
- this.setActive(!active);
-
-
+ this.setActive(!this.pressed);
+ this.fireEvent('toggle', this, e, !this.pressed);
},
/**
* get the current active state
this.hidden = false;
this.triggerEl.addClass('open');
- if(this.el.getWidth() + xy[0] > Roo.lib.Dom.getViewWidth()){
+ // reassign x when hitting right
+ if(this.el.getWidth() + xy[0] >= Roo.lib.Dom.getViewWidth()){
xy[0] = xy[0] - this.el.getWidth() + this.triggerEl.getWidth();
}
+ // reassign y when hitting bottom
+ if(this.el.getHeight() + xy[1] >= Roo.lib.Dom.getViewHeight()){
+ xy[1] = xy[1] - this.el.getHeight() - this.triggerEl.getHeight();
+ }
+
+ // but the list may align on trigger left or trigger top... should it be a properity?
+
if(this.el.getStyle('top') != 'auto' && this.el.getStyle('top').slice(-1) != "%"){
this.el.setXY(xy);
}
}
}
- this.maskEl = new Roo.LoadMask(this.el, { store : this.ds, msgCls: 'roo-el-mask-msg' });
+ if(this.loadMask) {
+ this.maskEl = new Roo.LoadMask(this.el, { store : this.ds, msgCls: 'roo-el-mask-msg' });
+ }
this.store.on('load', this.onLoad, this);
this.store.on('beforeload', this.onBeforeLoad, this);
e.on('mouseout', _this.onMouseout, _this);
});
this.fireEvent('rowsrendered', this);
- //if(this.loadMask){
- // this.maskEl.hide();
- //}
this.autoSize();
},
onBeforeLoad : function()
{
- //Roo.log('ds onBeforeLoad');
- //this.clear();
-
- //if(this.loadMask){
- // this.maskEl.show();
- //}
},
/**
* Remove all rows
* @cfg {String} autocomplete - default is new-password see: https://developers.google.com/web/fundamentals/input/form/label-and-name-inputs?hl=en
* @cfg {String} indicatorpos (left|right) default left
* @cfg {String} capture (user|camera) use for file input only. (default empty)
+ * @cfg {String} accept (image|video|audio) use for file input only. (default empty)
* @cfg {String} align (left|center|right) Default left
* @cfg {Boolean} forceFeedback (true|false) Default false
labelxs : 0,
capture : '',
+ accept : '',
parentLabelAlign : function()
{
input.capture = this.capture;
}
+ if(this.accept.length){
+ input.accept = this.accept + "/*";
+ }
+
if(this.align){
input.style = (typeof(input.style) == 'undefined') ? ('text-align:' + this.align) : (input.style + 'text-align:' + this.align);
}
this.indicator = this.indicatorEl();
if(this.indicator){
- this.indicator.addClass('invisible');
+ this.indicator.addClass(this.indicatorpos == 'right' ? 'hidden' : 'invisible'); // changed from invisible??? -
}
// reference to original value for reset
if(this.indicator){
this.indicator.removeClass('visible');
- this.indicator.addClass('invisible');
+ this.indicator.addClass(this.indicatorpos == 'right' ? 'hidden' : 'invisible');
}
if(this.disabled){
}
if(this.indicator){
- this.indicator.removeClass('invisible');
+ this.indicator.removeClass(this.indicatorpos == 'right' ? 'hidden' : 'invisible');
this.indicator.addClass('visible');
}
this.picker().select('>.datepicker-days tbody',true).first().dom.innerHTML = '';
- while(prevMonth.valueOf() < nextMonth) {
+ while(prevMonth.valueOf() <= nextMonth) {
var clsName = '';
if (prevMonth.getUTCDay() === this.weekStart) {
weight : false,
inline: false,
tooltip : '',
+ useFontAwesomeCheckBox : false,
getAutoCreate : function()
{
html: this.boxLabel
};
+ if(this.useFontAwesomeCheckBox) {
+ boxLabelCfg.cls = 'box-label fa-checkbox'
+ }
+
if(this.tooltip){
boxLabelCfg.tooltip = this.tooltip;
}
if (v.match(/^\./) || v.match(/^\//)) {
return;
}
- if (v.match(/^(http|https):\/\//) || v.match(/^mailto:/)) {
+ if (v.match(/^(http|https):\/\//) || v.match(/^mailto:/) || v.match(/^ftp:/)) {
return;
}
if (v.match(/^#/)) {
if(this.buttons){
Roo.each(_this.buttons, function(e){ // this might need to use render????
- Roo.factory(e).onRender(_this.el, null);
+ Roo.factory(e).render(_this.el);
});
}
getAutoCreate : function(){
+ var cls = "";
+ if (!this.allowBlank) {
+ cls = "visible";
+ }
+
var cfg = {
tag : this.tag,
cls : 'roo-bootstrap-field-label ' + this.cls,
cn : [
{
tag : 'i',
- cls : 'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',
+ cls : 'roo-required-indicator left-indicator text-danger fa fa-lg fa-star ' + cls,
tooltip : this.iconTooltip
},
{
},
{
tag : 'i',
- cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
+ cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star '+ cls,
tooltip : this.iconTooltip
}
]
* if a valid character like '.' or '-' is left in the field with no number (defaults to "{value} is not a valid number")
*/
nanText : "{0} is not a valid number",
- /**
- * @cfg {Boolean} castInt (true|false) cast int if true (defalut true)
- */
- castInt : true,
/**
* @cfg {String} thousandsDelimiter Symbol of thousandsDelimiter
*/
beforeBlur : function()
{
- if(!this.castInt){
- return;
- }
-
var v = this.parseValue(this.getRawValue());
- if(v || v === 0){
+ if(v || v === 0 || v === ''){
this.setValue(v);
}
},