X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/b37ceabb82336ee82757cd32efe353cfab8ec267..f5240829880f87e0cf581c6a296e436fdef0ef80:/src/ext-core/src/core/EventManager.js
diff --git a/src/ext-core/src/core/EventManager.js b/src/ext-core/src/core/EventManager.js
index cd2a4498..6f691652 100644
--- a/src/ext-core/src/core/EventManager.js
+++ b/src/ext-core/src/core/EventManager.js
@@ -1,5 +1,5 @@
/*!
- * Ext JS Library 3.2.2
+ * Ext JS Library 3.3.0
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
@@ -11,7 +11,6 @@
* See {@link Ext.EventObject} for more details on normalized event objects.
* @singleton
*/
-
Ext.EventManager = function(){
var docReadyEvent,
docReadyProcId,
@@ -34,11 +33,11 @@ Ext.EventManager = function(){
var id = false,
i = 0,
len = specialElCache.length,
- id = false,
skip = false,
o;
- if(el){
- if(el.getElementById || el.navigator){
+
+ if (el) {
+ if (el.getElementById || el.navigator) {
// look up the id
for(; i < len; ++i){
o = specialElCache[i];
@@ -67,7 +66,7 @@ Ext.EventManager = function(){
}
}
return id;
- };
+ }
/// There is some jquery work around stuff here that isn't needed in Ext Core.
function addListener(el, ename, fn, task, wrap, scope){
@@ -103,7 +102,7 @@ Ext.EventManager = function(){
if(el == DOC && ename == "mousedown"){
Ext.EventManager.stoppedMouseDownEvent.addListener(wrap);
}
- };
+ }
function doScrollChk(){
/* Notes:
@@ -177,7 +176,7 @@ Ext.EventManager = function(){
docReadyEvent.listeners = [];
}
- };
+ }
function initDocReady(){
docReadyEvent || (docReadyEvent = new Ext.util.Event());
@@ -211,7 +210,7 @@ Ext.EventManager = function(){
}
// no matter what, make sure it fires on load
E.on(WINDOW, "load", fireDocReady);
- };
+ }
function createTargeted(h, o){
return function(){
@@ -220,21 +219,21 @@ Ext.EventManager = function(){
h.apply(this, args);
}
};
- };
+ }
function createBuffered(h, o, task){
return function(e){
// create new event object impl so new events don't wipe out properties
task.delay(o.buffer, h, null, [new Ext.EventObjectImpl(e)]);
};
- };
+ }
function createSingle(h, el, ename, fn, scope){
return function(e){
Ext.EventManager.removeListener(el, ename, fn, scope);
h(e);
};
- };
+ }
function createDelayed(h, o, fn){
return function(e){
@@ -245,7 +244,7 @@ Ext.EventManager = function(){
fn.tasks.push(task);
task.delay(o.delay || 10, h, null, [new Ext.EventObjectImpl(e)]);
};
- };
+ }
function listen(element, ename, opt, fn, scope){
var o = (!opt || typeof opt == "boolean") ? {} : opt,
@@ -280,12 +279,12 @@ Ext.EventManager = function(){
if (o.stopPropagation) {
e.stopPropagation();
}
- if (o.normalized) {
+ if (o.normalized === false) {
e = e.browserEvent;
}
fn.call(scope || el, e, t, o);
- };
+ }
if(o.target){
h = createTargeted(h, o);
}
@@ -302,7 +301,7 @@ Ext.EventManager = function(){
addListener(el, ename, fn, task, h, scope);
return h;
- };
+ }
var pub = {
/**
@@ -533,13 +532,13 @@ Ext.EventManager = function(){
* {single: true}
be used so that the handler is removed on first invocation.
*/
onDocumentReady : function(fn, scope, options){
- if(Ext.isReady){ // if it already fired or document.body is present
+ if (Ext.isReady) { // if it already fired or document.body is present
docReadyEvent || (docReadyEvent = new Ext.util.Event());
docReadyEvent.addListener(fn, scope, options);
docReadyEvent.fire();
docReadyEvent.listeners = [];
- }else{
- if(!docReadyEvent){
+ } else {
+ if (!docReadyEvent) {
initDocReady();
}
options = options || {};
@@ -595,45 +594,112 @@ Ext.onReady = Ext.EventManager.onDocumentReady;
//Initialize doc classes
(function(){
-
- var initExtCss = function(){
+ var initExtCss = function() {
// find the body element
var bd = document.body || document.getElementsByTagName('body')[0];
- if(!bd){ return false; }
+ if (!bd) {
+ return false;
+ }
+
var cls = [' ',
Ext.isIE ? "ext-ie " + (Ext.isIE6 ? 'ext-ie6' : (Ext.isIE7 ? 'ext-ie7' : 'ext-ie8'))
: Ext.isGecko ? "ext-gecko " + (Ext.isGecko2 ? 'ext-gecko2' : 'ext-gecko3')
: Ext.isOpera ? "ext-opera"
: Ext.isWebKit ? "ext-webkit" : ""];
- if(Ext.isSafari){
+ if (Ext.isSafari) {
cls.push("ext-safari " + (Ext.isSafari2 ? 'ext-safari2' : (Ext.isSafari3 ? 'ext-safari3' : 'ext-safari4')));
- }else if(Ext.isChrome){
+ } else if(Ext.isChrome) {
cls.push("ext-chrome");
}
- if(Ext.isMac){
+ if (Ext.isMac) {
cls.push("ext-mac");
}
- if(Ext.isLinux){
+ if (Ext.isLinux) {
cls.push("ext-linux");
}
- if(Ext.isStrict || Ext.isBorderBox){ // add to the parent to allow for selectors like ".ext-strict .ext-ie"
+ // add to the parent to allow for selectors like ".ext-strict .ext-ie"
+ if (Ext.isStrict || Ext.isBorderBox) {
var p = bd.parentNode;
- if(p){
- p.className += Ext.isStrict ? ' ext-strict' : ' ext-border-box';
+ if (p) {
+ Ext.fly(p, '_internal').addClass(((Ext.isStrict && Ext.isIE ) || (!Ext.enableForcedBoxModel && !Ext.isIE)) ? ' ext-strict' : ' ext-border-box');
}
}
- bd.className += cls.join(' ');
+ // Forced border box model class applied to all elements. Bypassing javascript based box model adjustments
+ // in favor of css. This is for non-IE browsers.
+ if (Ext.enableForcedBoxModel && !Ext.isIE) {
+ Ext.isForcedBorderBox = true;
+ cls.push("ext-forced-border-box");
+ }
+
+ Ext.fly(bd, '_internal').addClass(cls);
return true;
- }
+ };
- if(!initExtCss()){
+ /*
+ * Assert Ext.isReady here. If Ext is loaded after the document is ready, none of the native
+ * DOM onReady events will fire, because they have already passed.
+ */
+ Ext.isReady = initExtCss();
+
+ if (!Ext.isReady) {
Ext.onReady(initExtCss);
}
})();
+/**
+ * Code used to detect certain browser feature/quirks/bugs at startup.
+ */
+(function(){
+ var supports = Ext.apply(Ext.supports, {
+ /**
+ * In Webkit, there is an issue with getting the margin right property, see
+ * https://bugs.webkit.org/show_bug.cgi?id=13343
+ */
+ correctRightMargin: true,
+
+ /**
+ * Webkit browsers return rgba(0, 0, 0) when a transparent color is used
+ */
+ correctTransparentColor: true,
+
+ /**
+ * IE uses styleFloat, not cssFloat for the float property.
+ */
+ cssFloat: true
+ });
+
+ var supportTests = function(){
+ var div = document.createElement('div'),
+ doc = document,
+ view,
+ last;
+
+ div.innerHTML = '