X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775:/docs/source/Ext-more.html diff --git a/docs/source/Ext-more.html b/docs/source/Ext-more.html index 5629b66d..a047fc57 100644 --- a/docs/source/Ext-more.html +++ b/docs/source/Ext-more.html @@ -1,11 +1,17 @@ - - - The source code - - - - -
/**
+
+
+  The source code
+    
+    
+
+
+    
/*!
+ * Ext JS Library 3.0.3
+ * Copyright(c) 2006-2009 Ext JS, LLC
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+/**
  * @class Ext
  */
 
@@ -18,7 +24,9 @@ Ext.ns("Ext.grid", "Ext.dd", "Ext.tree", "Ext.form", "Ext.menu",
      */
 
 Ext.apply(Ext, function(){
-    var E = Ext, idSeed = 0;
+    var E = Ext, 
+        idSeed = 0,
+        scrollWidth = null;
 
     return {
         
/** @@ -34,7 +42,7 @@ Ext.apply(Ext, function(){ * For other browsers it uses an inline data URL. * @type String */ - BLANK_IMAGE_URL : Ext.isIE6 || Ext.isIE7 ? + BLANK_IMAGE_URL : Ext.isIE6 || Ext.isIE7 || Ext.isAir ? 'http:/' + '/extjs.com/s.gif' : 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', @@ -50,15 +58,6 @@ Ext.apply(Ext, function(){ return Ext.get(document); }, -
/** - * Returns true if the passed object is a JavaScript date object, otherwise false. - * @param {Object} object The object to test - * @return {Boolean} - */ - isDate : function(v){ - return Object.prototype.toString.apply(v) === '[object Date]'; - }, -
/** * Utility method for validating that a value is numeric, returning the specified default value if it is not. * @param {Mixed} value Should be a number, but any type will be handled appropriately @@ -66,7 +65,7 @@ Ext.apply(Ext, function(){ * @return {Number} Value, if numeric, else defaultValue */ num : function(v, defaultValue){ - v = Number(v === null || typeof v == 'boolean'? NaN : v); + v = Number(Ext.isEmpty(v) || Ext.isBoolean(v) ? NaN : v); return isNaN(v)? defaultValue : v; }, @@ -93,7 +92,7 @@ Ext.apply(Ext, function(){ * @return {String} */ escapeRe : function(s) { - return s.replace(/([.*+?^${}()|[\]\/\\])/g, "\\$1"); + return s.replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1"); }, sequence : function(o, name, fn, scope){ @@ -140,6 +139,31 @@ Ext.addBehaviors({ cache = null; } }, + +
/** + * Utility method for getting the width of the browser scrollbar. This can differ depending on + * operating system settings, such as the theme or font size. + * @param {Boolean} force (optional) true to force a recalculation of the value. + * @return {Number} The width of the scrollbar. + */ + getScrollBarWidth: function(force){ + if(!Ext.isReady){ + return 0; + } + + if(force === true || scrollWidth === null){ + // Append our div, do our calculation and then remove it + var div = Ext.getBody().createChild('
'), + child = div.child('div', true); + var w1 = child.offsetWidth; + div.setStyle('overflow', (Ext.isWebKit || Ext.isGecko) ? 'auto' : 'scroll'); + var w2 = child.offsetWidth; + div.remove(); + // Need to add 2 to ensure we leave enough space + scrollWidth = w1 - w2 + 2; + } + return scrollWidth; + }, // deprecated @@ -176,7 +200,7 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { * @return {Object} The modified object. */ copyTo : function(dest, source, names){ - if(typeof names == 'string'){ + if(Ext.isString(names)){ names = names.split(/[,;\s]/); } Ext.each(names, function(name){ @@ -378,7 +402,7 @@ Ext.invoke(Ext.query("p"), "getAttribute", "id"); var ret = [], args = Array.prototype.slice.call(arguments, 2); Ext.each(arr, function(v,i) { - if (v && typeof v[methodName] == "function") { + if (v && Ext.isFunction(v[methodName])) { ret.push(v[methodName].apply(v, args)); } else { ret.push(undefined); @@ -502,7 +526,7 @@ Ext.zip( case RegExp: return 'regexp'; case Date: return 'date'; } - if(typeof o.length == 'number' && typeof o.item == 'function') { + if(Ext.isNumber(o.length) && Ext.isFunction(o.item)) { return 'nodelist'; } } @@ -549,7 +573,8 @@ var sayGoodbye = sayHi.createSequence(function(name){ sayGoodbye('Fred'); // both alerts show
* @param {Function} fcn The function to sequence - * @param {Object} scope (optional) The scope of the passed fcn (Defaults to scope of original function or window) + * @param {Object} scope (optional) The scope (this reference) in which the passed function is executed. + * If omitted, defaults to the scope in which the original function is called or the browser window. * @return {Function} The new function */ createSequence : function(fcn, scope){ @@ -668,6 +693,6 @@ Ext.applyIf(Number.prototype, { return Math.min(Math.max(this, min), max); } }); -
- + + \ No newline at end of file