X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-core-debug.js;h=f2e187a957790a87f4d4093e1e2f8cce081d849b;hb=e01802ac69da0ec0c9ccecc295beff82c1779f68;hp=5a246a85f40cc144517e3d879dcea6f638e36aae;hpb=d83e6f560d529fee838ee06b89f8f6872c2dd0ea;p=roojs1 diff --git a/roojs-core-debug.js b/roojs-core-debug.js index 5a246a85f4..f2e187a957 100644 --- a/roojs-core-debug.js +++ b/roojs-core-debug.js @@ -668,7 +668,30 @@ Roo.factory(conf, Roo.data); { var node = Roo.DomQuery.selectNode(selector,root); return node ? Roo.get(node) : new Roo.Element(false); - } + }, + /** + * Find the current bootstrap width Grid size + * Note xs is the default for smaller.. - this is currently used by grids to render correct columns + * @returns {String} (xs|sm|md|lg|xl) + */ + + getGridSize : function() + { + var w = Roo.lib.Dom.getViewWidth(); + switch(true) { + case w > 1200: + return 'xl'; + case w > 992: + return 'lg'; + case w > 768: + return 'md'; + case w > 576: + return 'sm'; + default: + return 'xs' + } + + } }); @@ -4336,7 +4359,7 @@ Roo.DomHelper = function(){ var ieTable = function(depth, s, h, e){ tempTableEl.innerHTML = [s, h, e].join(''); var i = -1, el = tempTableEl; - while(++i < depth){ + while(++i < depth && el.firstChild){ el = el.firstChild; } return el; @@ -5066,7 +5089,11 @@ Roo.DomQuery = function(){ } var r = [], ri = -1, cn; for(var i = 0, ci; ci = c[i]; i++){ - if((' '+ci.className+' ').indexOf(v) != -1){ + + + if((' '+ + ( (ci instanceof SVGElement) ? ci.className.baseVal : ci.className) + +' ').indexOf(v) != -1){ r[++ri] = ci; } } @@ -5084,7 +5111,7 @@ Roo.DomQuery = function(){ return n.htmlFor; } if(attr == "class" || attr == "className"){ - return n.className; + return (n instanceof SVGElement) ? n.className.baseVal : n.className; } return n.getAttribute(attr) || n[attr]; @@ -5188,7 +5215,7 @@ Roo.DomQuery = function(){ a = Roo.DomQuery.getStyle(ci, attr); } else if(attr == "class" || attr == "className"){ - a = ci.className; + a = (ci instanceof SVGElement) ? ci.className.baseVal : ci.className; }else if(attr == "for"){ a = ci.htmlFor; }else if(attr == "href"){ @@ -7153,6 +7180,9 @@ if(opt.anim.isAnimated()){ { var dom = typeof element == "string" ? document.getElementById(element) : element; + + this.listeners = {}; + if(!dom){ // invalid id/element return null; } @@ -7173,7 +7203,7 @@ if(opt.anim.isAnimated()){ */ this.id = id || Roo.id(dom); - this.listeners = {}; + return this; // assumed for cctor? }; var El = Roo.Element; @@ -8294,7 +8324,7 @@ if(opt.anim.isAnimated()){ //action on double tap goes below }, - + /** * Removes an event handler from this element * @param {String} eventName the type of event to remove @@ -8304,7 +8334,7 @@ if(opt.anim.isAnimated()){ */ removeListener : function(eventName, fn, scope){ Roo.EventManager.removeListener(this.dom, eventName, fn); - if (typeof(this.listeners[eventName]) == 'undefined') { + if (typeof(this.listeners) == 'undefined' || typeof(this.listeners[eventName]) == 'undefined') { return this; } this.listeners[eventName].removeListener(fn, scope); @@ -9445,7 +9475,7 @@ if(opt.anim.isAnimated()){ Roo.EventManager.removeResizeListener(this.fitToParentDelegate); // always remove previous fitToParent delegate from onWindowResize this.fitToParentDelegate = Roo.emptyFn; // remove reference to previous delegate if (monitorResize === true && !this.dom.parentNode) { // check if this Element still exists - return; + return this; } var p = Roo.get(targetParent || this.dom.parentNode); this.setSize(p.getComputedWidth() - p.getFrameWidth('lr'), p.getComputedHeight() - p.getFrameWidth('tb'));