X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=roojs-bootstrap-debug.js;h=ea98f39293ebc9d9850e83975b91a05af6fe48ec;hp=f547fb4135a357ea2ab34b137e12a21bc27fb443;hb=8f5eb4c4c8c1b9d0a7198e29efe26ac2d9e0bff8;hpb=decbd95de2b8ac4505902e151302adbe67480a7b diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index f547fb4135..ea98f39293 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -1,4 +1,4 @@ -/** +Roo.bootstrap = {};/** * set the version of bootstrap based on the stylesheet... * */ @@ -14,7 +14,10 @@ Roo.bootstrap.version = ( function() { Roo.Element.prototype.visibilityMode = Roo.Element.DISPLAY; } return ret; -})(); /* +})(); Roo.bootstrap.menu = Roo.bootstrap.menu || {}; +Roo.bootstrap.nav = {}; + +Roo.bootstrap.form = {};Roo.bootstrap.panel = {};Roo.bootstrap.layout = {};/* * Based on: * Ext JS Library 1.1.1 * Copyright(c) 2006-2007, Ext JS, LLC. @@ -95,6 +98,7 @@ Roo.Shadow.prototype = { * frame: Shadow displays equally on all four sides
* drop: Traditional bottom-right drop shadow (default) */ + mode: false, /** * @cfg {String} offset * The number of pixels to offset the shadow from the element (defaults to 4) @@ -222,6 +226,8 @@ Roo.bootstrap = Roo.bootstrap || {}; /** * @class Roo.bootstrap.Component * @extends Roo.Component + * @abstract + * @children Roo.bootstrap.Component * Bootstrap Component base class * @cfg {String} cls css class * @cfg {String} style any extra css @@ -330,11 +336,11 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { } if (this.cls) { - cfg.cls = (typeof(cfg.cls) == 'undefined') ? this.cls : cfg.cls + ' ' + this.cls; + cfg.cls = (typeof(cfg.cls) == 'undefined' ? this.cls : cfg.cls) + ' ' + this.cls; } if (this.style) { // fixme needs to support more complex style data. - cfg.style = this.style; + cfg.style = (typeof(cfg.style) == 'undefined' ? this.style : cfg.style) + '; ' + this.style; } if(this.name){ @@ -649,7 +655,9 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { /** * @class Roo.bootstrap.Element * @extends Roo.bootstrap.Component - * Bootstrap Element class + * @children Roo.bootstrap.Component + * Bootstrap Element class (basically a DIV used to make random stuff ) + * * @cfg {String} html contents of the element * @cfg {String} tag tag of the element * @cfg {String} cls class of the element @@ -847,6 +855,8 @@ Roo.extend(Roo.bootstrap.DropTarget, Roo.bootstrap.Element, { /** * @class Roo.bootstrap.Body * @extends Roo.bootstrap.Component + * @children Roo.bootstrap.Component + * @parent none builder * Bootstrap Body class * * @constructor @@ -898,6 +908,8 @@ Roo.extend(Roo.bootstrap.Body, Roo.bootstrap.Component, { * @class Roo.bootstrap.ButtonGroup * @extends Roo.bootstrap.Component * Bootstrap ButtonGroup class + * @children Roo.bootstrap.Button Roo.bootstrap.form.Form + * * @cfg {String} size lg | sm | xs (default empty normal) * @cfg {String} align vertical | justified (default none) * @cfg {String} direction up | down (default down) @@ -1004,7 +1016,8 @@ Roo.extend(Roo.bootstrap.ButtonGroup, Roo.bootstrap.Component, { * @cfg {Boolean} removeClass remove the standard class.. * @cfg {String} target (_self|_blank|_parent|_top|other) target for a href. * @cfg {Boolean} grpup if parent is a btn group - then it turns it into a toogleGroup. - * + * @cfg {Roo.bootstrap.menu.Menu} menu a Menu + * @constructor * Create a new button * @param {Object} config The config object @@ -1327,7 +1340,7 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { } Roo.log('button on click '); - if(this.preventDefault){ + if(this.href === '' || this.preventDefault){ e.preventDefault(); } @@ -1465,6 +1478,7 @@ Roo.bootstrap.Button.weights = [ /** * @class Roo.bootstrap.Column * @extends Roo.bootstrap.Component + * @children Roo.bootstrap.Component * Bootstrap Column class * @cfg {Number} xs colspan out of 12 for mobile-sized screens or 0 for hidden * @cfg {Number} sm colspan out of 12 for tablet-sized screens or 0 for hidden @@ -1592,6 +1606,8 @@ Roo.extend(Roo.bootstrap.Column, Roo.bootstrap.Component, { /** * @class Roo.bootstrap.Container * @extends Roo.bootstrap.Component + * @children Roo.bootstrap.Component + * @parent builder * Bootstrap Container class * @cfg {Boolean} jumbotron is it a jumbotron element * @cfg {String} html content of element @@ -1955,16 +1971,12 @@ Roo.extend(Roo.bootstrap.Container, Roo.bootstrap.Component, { } }); - /* - * - LGPL - * - * This is BS4's Card element.. - similar to our containers probably.. - * - */ -/** + /** * @class Roo.bootstrap.Card * @extends Roo.bootstrap.Component - * Bootstrap Card class + * @children Roo.bootstrap.Component + * @licence LGPL + * Bootstrap Card class - note this has children as CardHeader/ImageTop/Footer.. - which should really be listed properties? * * * possible... may not be implemented.. @@ -2765,6 +2777,8 @@ Roo.extend(Roo.bootstrap.Card, Roo.bootstrap.Component, { /** * @class Roo.bootstrap.CardHeader * @extends Roo.bootstrap.Element + * @parent Roo.bootstrap.Card + * @children Roo.bootstrap.Component * Bootstrap CardHeader class * @constructor * Create a new Card Header - that you can embed children into @@ -2798,7 +2812,10 @@ Roo.extend(Roo.bootstrap.CardHeader, Roo.bootstrap.Element, { /** * @class Roo.bootstrap.CardFooter * @extends Roo.bootstrap.Element + * @parent Roo.bootstrap.Card + * @children Roo.bootstrap.Component * Bootstrap CardFooter class + * * @constructor * Create a new Card Footer - that you can embed children into * @param {Object} config The config object @@ -2831,7 +2848,10 @@ Roo.extend(Roo.bootstrap.CardFooter, Roo.bootstrap.Element, { /** * @class Roo.bootstrap.CardImageTop * @extends Roo.bootstrap.Element + * @parent Roo.bootstrap.Card + * @children Roo.bootstrap.Component * Bootstrap CardImageTop class + * * @constructor * Create a new Card Image Top container * @param {Object} config The config object @@ -2915,22 +2935,12 @@ Roo.extend(Roo.bootstrap.ButtonUploader, Roo.bootstrap.Button, { getAutoCreate : function() { - var im = { - tag: 'input', - type : 'file', - cls : 'd-none roo-card-upload-selector' - - }; - if (this.multiple) { - im.multiple = 'multiple'; - } + return { cls :'div' , cn : [ - Roo.bootstrap.Button.prototype.getAutoCreate.call(this), - im - + Roo.bootstrap.Button.prototype.getAutoCreate.call(this) ] }; @@ -2951,10 +2961,18 @@ Roo.extend(Roo.bootstrap.ButtonUploader, Roo.bootstrap.Button, { (window.URL && URL.revokeObjectURL && URL) || (window.webkitURL && webkitURL); - - - - this.selectorEl = this.el.select('.roo-card-upload-selector', true).first(); + var im = { + tag: 'input', + type : 'file', + cls : 'd-none roo-card-upload-selector' + + }; + if (this.multiple) { + im.multiple = 'multiple'; + } + this.selectorEl = Roo.get(document.body).createChild(im); // so it does not capture click event for navitem. + + //this.selectorEl = this.el.select('.roo-card-upload-selector', true).first(); this.selectorEl.on('change', this.onFileSelected, this); @@ -3043,6 +3061,7 @@ Roo.extend(Roo.bootstrap.ButtonUploader, Roo.bootstrap.Button, { * @cfg {String} smUrl sm image source * @cfg {String} mdUrl md image source * @cfg {String} lgUrl lg image source + * @cfg {Boolean} backgroundContain (use style background and contain image in content) * * @constructor * Create a new Input @@ -3059,7 +3078,13 @@ Roo.bootstrap.Img = function(config){ * The img click event for the img. * @param {Roo.EventObject} e */ - "click" : true + "click" : true, + /** + * @event load + * The when any image loads + * @param {Roo.EventObject} e + */ + "load" : true }); }; @@ -3074,6 +3099,7 @@ Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component, { smUrl: '', mdUrl: '', lgUrl: '', + backgroundContain : false, getAutoCreate : function() { @@ -3146,12 +3172,20 @@ Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component, { tag: 'img', cls: (this.imgResponsive) ? 'img-responsive' : '', html : null, - src : 'about:blank' // just incase src get's set to undefined?!? + src : Roo.BLANK_IMAGE_URL // just incase src get's set to undefined?!? }; + if (this.backgroundContain) { + cfg.cls += ' background-contain'; + } + cfg.html = this.html || cfg.html; - cfg.src = this.src || cfg.src; + if (this.backgroundContain) { + cfg.style="background-image: url(" + this.src + ')'; + } else { + cfg.src = this.src || cfg.src; + } if (['rounded','circle','thumbnail'].indexOf(this.border)>-1) { cfg.cls += ' img-' + this.border; @@ -3184,6 +3218,12 @@ Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component, { if(!this.href){ this.el.on('click', this.onClick, this); } + if(this.src || (!this.xsUrl && !this.smUrl && !this.mdUrl && !this.lgUrl)){ + this.el.on('load', this.onImageLoad, this); + } else { + // not sure if this works.. not tested + this.el.select('img', true).on('load', this.onImageLoad, this); + } }, @@ -3192,6 +3232,12 @@ Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component, { Roo.log('img onclick'); this.fireEvent('click', this, e); }, + onImageLoad: function(e) + { + Roo.log('img load'); + this.fireEvent('load', this, e); + }, + /** * Sets the url of the image - used to update it * @param {String} url the url of the image @@ -3202,7 +3248,11 @@ Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component, { this.src = url; if(this.src || (!this.xsUrl && !this.smUrl && !this.mdUrl && !this.lgUrl)){ - this.el.dom.src = url; + if (this.backgroundContain) { + this.el.dom.style.backgroundImage = 'url(' + url + ')'; + } else { + this.el.dom.src = url; + } return; } @@ -3224,7 +3274,9 @@ Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component, { /** * @class Roo.bootstrap.Link * @extends Roo.bootstrap.Component - * Bootstrap Link Class + * @children Roo.bootstrap.Component + * Bootstrap Link Class (eg. '') + * @cfg {String} alt image alternative text * @cfg {String} href a tag href * @cfg {String} target (_self|_blank|_parent|_top) target for a href. @@ -3328,7 +3380,10 @@ Roo.extend(Roo.bootstrap.Link, Roo.bootstrap.Component, { /** * @class Roo.bootstrap.Header * @extends Roo.bootstrap.Component + * @children Roo.bootstrap.Component * Bootstrap Header class + * + * * @cfg {String} html content of header * @cfg {Number} level (1|2|3|4|5|6) default 1 * @@ -3366,23 +3421,13 @@ Roo.extend(Roo.bootstrap.Header, Roo.bootstrap.Component, { - /* - * Based on: - * Ext JS Library 1.1.1 - * Copyright(c) 2006-2007, Ext JS, LLC. - * - * Originally Released Under LGPL - original licence link has changed is not relivant. - * - * Fork - LGPL - *