X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6a7e4474cba9d8be4b2ec445e10f1691f7277c50..6b044c28b5f26fb99c86c237ffad19741c0f7f3d:/src/core/Element-more.js?ds=sidebyside
diff --git a/src/core/Element-more.js b/src/core/Element-more.js
index 11305b3e..f0f22207 100644
--- a/src/core/Element-more.js
+++ b/src/core/Element-more.js
@@ -1,8 +1,8 @@
/*!
- * Ext JS Library 3.2.0
- * Copyright(c) 2006-2010 Ext JS, Inc.
- * licensing@extjs.com
- * http://www.extjs.com/license
+ * Ext JS Library 3.3.1
+ * Copyright(c) 2006-2010 Sencha Inc.
+ * licensing@sencha.com
+ * http://www.sencha.com/license
*/
/**
* @class Ext.Element
@@ -14,15 +14,16 @@ Ext.Element.addMethods({
* @param {Boolean} preventDefault (optional) true to prevent the default action too
* @return {Ext.Element} this
*/
- swallowEvent : function(eventName, preventDefault){
+ swallowEvent : function(eventName, preventDefault) {
var me = this;
- function fn(e){
+ function fn(e) {
e.stopPropagation();
- if(preventDefault){
+ if (preventDefault) {
e.preventDefault();
}
}
- if(Ext.isArray(eventName)){
+
+ if (Ext.isArray(eventName)) {
Ext.each(eventName, function(e) {
me.on(e, fn);
});
@@ -39,8 +40,8 @@ Ext.Element.addMethods({
* @param {Object} object Any object that extends {@link Ext.util.Observable} that will provide the context
* for firing the relayed event
*/
- relayEvent : function(eventName, observable){
- this.on(eventName, function(e){
+ relayEvent : function(eventName, observable) {
+ this.on(eventName, function(e) {
observable.fireEvent(eventName, e);
});
},
@@ -52,25 +53,26 @@ Ext.Element.addMethods({
* you can call this over and over. However, if you update the element and
* need to force a reclean, you can pass true.
*/
- clean : function(forceReclean){
- var me = this,
+ clean : function(forceReclean) {
+ var me = this,
dom = me.dom,
- n = dom.firstChild,
- ni = -1;
+ n = dom.firstChild,
+ ni = -1;
- if(Ext.Element.data(dom, 'isCleaned') && forceReclean !== true){
+ if (Ext.Element.data(dom, 'isCleaned') && forceReclean !== true) {
return me;
}
- while(n){
+ while (n) {
var nx = n.nextSibling;
- if(n.nodeType == 3 && !/\S/.test(n.nodeValue)){
+ if (n.nodeType == 3 && !(/\S/.test(n.nodeValue))) {
dom.removeChild(n);
- }else{
+ } else {
n.nodeIndex = ++ni;
}
n = nx;
}
+
Ext.Element.data(dom, 'isCleaned', true);
return me;
},
@@ -80,9 +82,10 @@ Ext.Element.addMethods({
* parameter as {@link Ext.Updater#update}
* @return {Ext.Element} this
*/
- load : function(){
- var um = this.getUpdater();
- um.update.apply(um, arguments);
+ load : function() {
+ var updateManager = this.getUpdater();
+ updateManager.update.apply(updateManager, arguments);
+
return this;
},
@@ -90,7 +93,7 @@ Ext.Element.addMethods({
* Gets this element's {@link Ext.Updater Updater}
* @return {Ext.Updater} The Updater
*/
- getUpdater : function(){
+ getUpdater : function() {
return this.updateManager || (this.updateManager = new Ext.Updater(this));
},
@@ -101,30 +104,30 @@ Ext.Element.addMethods({
* @param {Function} callback (optional) For async script loading you can be notified when the update completes
* @return {Ext.Element} this
*/
- update : function(html, loadScripts, callback){
+ update : function(html, loadScripts, callback) {
if (!this.dom) {
return this;
}
html = html || "";
- if(loadScripts !== true){
+ if (loadScripts !== true) {
this.dom.innerHTML = html;
- if(Ext.isFunction(callback)){
+ if (typeof callback == 'function') {
callback();
}
return this;
}
- var id = Ext.id(),
+ var id = Ext.id(),
dom = this.dom;
html += '';
- Ext.lib.Event.onAvailable(id, function(){
- var DOC = document,
- hd = DOC.getElementsByTagName("head")[0],
- re = /(?: