X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo.js;h=aa2de28039437f69c133de49528c5f1a21304f3c;hb=50931ceebf763513e8ae7bd9ffd26ec9993967a2;hp=54e8329ee8b29a417f9dad3fbc6aca831d650638;hpb=d07f3a14e47379451580e744988d7aa3196614dc;p=roojs1 diff --git a/Roo.js b/Roo.js index 54e8329ee8..aa2de28039 100644 --- a/Roo.js +++ b/Roo.js @@ -19,7 +19,7 @@ window["undefined"] = window["undefined"]; /** * @class Roo * Roo core utilities and functions. - * @singleton + * @static */ var Roo = {}; /** @@ -342,8 +342,8 @@ Roo.factory(conf, Roo.data); if ((typeof(console) == 'undefined') || (typeof(console.log) == 'undefined')) { return; // alerT? } - console.log(s); + console.log(s); }, /** * Takes an object and converts it to an encoded URL. e.g. Roo.urlEncode({foo: 1, bar: 2}); would return "foo=1&bar=2". Optionally, property values can be arrays, instead of keys and the resulting string that's returned will contain a name/value pair for each array value. @@ -505,15 +505,18 @@ Roo.factory(conf, Roo.data); return s.replace(/([.*+?^${}()|[\]\/\\])/g, "\\$1"); }, - // internal - callback : function(cb, scope, args, delay){ - if(typeof cb == "function"){ - if(delay){ - cb.defer(delay, scope, args || []); - }else{ - cb.apply(scope, args || []); - } + // internal (non-delayed, will get a return value..) + callback : function(cb, scope, args, delay) + { + if(typeof cb != "function"){ + return false; + } + if(delay){ + cb.defer(delay, scope, args || []); + return false } + return cb.apply(scope, args || []); + }, /** @@ -668,7 +671,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' + } + + } }); @@ -677,6 +703,5 @@ Roo.factory(conf, Roo.data); Roo.namespace("Roo", "Roo.util", "Roo.grid", "Roo.dd", "Roo.tree", "Roo.data", "Roo.form", "Roo.menu", "Roo.state", "Roo.lib", "Roo.layout", - "Roo.app", "Roo.ux", - "Roo.bootstrap", - "Roo.bootstrap.dash"); + "Roo.app", "Roo.ux" + );