var isStrict = document.compatMode == "CSS1Compat",
isOpera = ua.indexOf("opera") > -1,
isSafari = (/webkit|khtml/).test(ua),
+ isFirefox = ua.indexOf("firefox") > -1,
isIE = ua.indexOf("msie") > -1,
isIE7 = ua.indexOf("msie 7") > -1,
+ isIE11 = /trident.*rv\:11\./.test(ua),
isGecko = !isSafari && ua.indexOf("gecko") > -1,
isBorderBox = isIE && !isStrict,
isWindows = (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1),
isMac = (ua.indexOf("macintosh") != -1 || ua.indexOf("mac os x") != -1),
isLinux = (ua.indexOf("linux") != -1),
isSecure = window.location.href.toLowerCase().indexOf("https") === 0,
- isTouch = 'ontouchstart' in window || window.DocumentTouch && document instanceof DocumentTouch;
+ isIOS = /iphone|ipad/.test(ua),
+ isTouch = (function() {
+ try {
+ document.createEvent("TouchEvent");
+ return true;
+ } catch (e) {
+ return false;
+ }
+
+ })();
// remove css image flicker
if(isIE && !isIE7){
try{
/** @type Boolean */
isSafari : isSafari,
/** @type Boolean */
+ isFirefox : isFirefox,
+ /** @type Boolean */
isIE : isIE,
/** @type Boolean */
isIE7 : isIE7,
/** @type Boolean */
+ isIE11 : isIE11,
+ /** @type Boolean */
isGecko : isGecko,
/** @type Boolean */
isBorderBox : isBorderBox,
/** @type Boolean */
isMac : isMac,
/** @type Boolean */
+ isIOS : isIOS,
+ /** @type Boolean */
isTouch : isTouch,
/**
"Roo.form", "Roo.menu", "Roo.state", "Roo.lib", "Roo.layout",
"Roo.app", "Roo.ux",
"Roo.bootstrap",
- "Roo.boostrap.dash");
+ "Roo.bootstrap.dash");
/*
* Based on:
* Ext JS Library 1.1.1
*/
Roo.applyIf(Array.prototype, {
/**
+ *
* Checks whether or not the specified object exists in the array.
* @param {Object} o The object to check for
* @return {Number} The index of o in the array (or -1 if it is not found)
/**
* @private
*/
+
Date.createParser = function(format) {
var funcName = "parse" + Date.parseFunctions.count++;
var regexNum = Date.parseRegexes.length;
+ "y = d.getFullYear();\n"
+ "m = d.getMonth();\n"
+ "d = d.getDate();\n"
+ + "if (typeof(input) !== 'string') { input = input.toString(); }\n"
+ "var results = input.match(Date.parseRegexes[" + regexNum + "]);\n"
+ "if (results && results.length > 0) {";
var regex = "";
if(attr=="cls" && Roo.isIE){
el.className = o["cls"];
}else{
- if(useSet) el.setAttribute(attr=="cls" ? 'class' : attr, o[attr]);
- else el[attr] = o[attr];
+ if(useSet) { el.setAttribute(attr=="cls" ? 'class' : attr, o[attr]);}
+ else {
+ el[attr] = o[attr];
+ }
}
}
Roo.DomHelper.applyStyles(el, o.style);
var E = Roo.lib.Event;
var D = Roo.lib.Dom;
+
+
var fireDocReady = function(){
if(!docReadyState){
}, o.delay || 10);
};
};
+ var transitionEndVal = false;
+
+ var transitionEnd = function()
+ {
+ if (transitionEndVal) {
+ return transitionEndVal;
+ }
+ var el = document.createElement('div');
+
+ var transEndEventNames = {
+ WebkitTransition : 'webkitTransitionEnd',
+ MozTransition : 'transitionend',
+ OTransition : 'oTransitionEnd otransitionend',
+ transition : 'transitionend'
+ };
+
+ for (var name in transEndEventNames) {
+ if (el.style[name] !== undefined) {
+ transitionEndVal = transEndEventNames[name];
+ return transitionEndVal ;
+ }
+ }
+ }
+
var listen = function(element, ename, opt, fn, scope){
var o = (!opt || typeof opt == "boolean") ? {} : opt;
fn = fn || o.fn; scope = scope || o.scope;
var el = Roo.getDom(element);
+
+
if(!el){
throw "Error listening for \"" + ename + '\". Element "' + element + '" doesn\'t exist.';
}
+
+ if (ename == 'transitionend') {
+ ename = transitionEnd();
+ }
var h = function(e){
e = Roo.EventObject.setEvent(e);
var t;
h = createBuffered(h, o);
}
fn._handlers = fn._handlers || [];
+
+
fn._handlers.push([Roo.id(el), ename, h]);
-
+
+
+
E.on(el, ename, h);
if(ename == "mousewheel" && el.addEventListener){ // workaround for jQuery
el.addEventListener("DOMMouseScroll", h, false);
if(Roo.isLinux){
cls.push("roo-linux");
}
+ if(Roo.isIOS){
+ cls.push("roo-ios");
+ }
if(Roo.isBorderBox){
cls.push('roo-border-box');
}
* @type String
*/
defaultUnit : "px",
+
+ pxReg : /^\d+(?:\.\d*)?px$/i,
/**
* Sets the element's visibility mode. When setVisible() is called it
* will use this to determine whether to set the visibility or the display property.
if(!local){
return this.getX();
}else{
+
return parseInt(this.getStyle("left"), 10) || 0;
+
+// var x = this.getStyle("left");
+//
+// if(!x || x === 'AUTO'){
+// return 0;
+// }
+//
+// if(this.pxReg.test(x)){
+// return parseFloat(x);
+// }
+//
+// x = this.getX();
+//
+// var par = this.dom.offsetParent ? Roo.fly(this.dom.offsetParent) : false;
+//
+// if (par !== false) {
+// x -= par.getX();
+// }
+//
+// return x;
}
},
*/
mask : function(msg, msgCls)
{
- if(this.getStyle("position") == "static"){
+ if(this.getStyle("position") == "static" && this.dom.tagName !== 'BODY'){
this.setStyle("position", "relative");
}
if(!this._mask){
}
var mm = this._maskMsg;
mm.dom.className = msgCls ? "roo-el-mask-msg " + msgCls : "roo-el-mask-msg";
- mm.dom.firstChild.innerHTML = msg;
+ if (mm.dom.firstChild) { // weird IE issue?
+ mm.dom.firstChild.innerHTML = msg;
+ }
mm.setDisplayed(true);
mm.center(this);
mm.setStyle('z-index', z + 102);
destroy : true
});
if(!this.id){
- this.id = "ext-comp-" + (++Roo.Component.AUTO_ID);
+ this.id = "roo-comp-" + (++Roo.Component.AUTO_ID);
}
Roo.ComponentMgr.register(this);
Roo.Component.superclass.constructor.call(this);
* Whether the component can move the Dom node when rendering (defaults to true).
*/
allowDomMove : true,
- /** @cfg {String} hideMode
+ /** @cfg {String} hideMode (display|visibility)
* How this component should hidden. Supported values are
* "visibility" (css visibility), "offsets" (negative offset position) and
* "display" (css display) - defaults to "display".
el = el || false;
var hp = this.parent ? 1 : 0;
- Roo.log(this);
+ Roo.debug && Roo.log(this);
if (!el && typeof(this.parent) == 'string' && this.parent.substring(0,1) == '#') {
// if parent is a '#.....' string, then let's use that..
var ename = this.parent.substr(1);
this.parent = false;
- Roo.log(ename);
+ Roo.debug && Roo.log(ename);
switch (ename) {
case 'bootstrap-body' :
if (typeof(Roo.bootstrap.Body) != 'undefined') {
this.parent = { el : new Roo.bootstrap.Body() };
- Roo.log("setting el to doc body");
+ Roo.debug && Roo.log("setting el to doc body");
} else {
throw "Container is bootstrap body, but Roo.bootstrap.Body is not defined";
if (!el && !this.parent) {
- Roo.log("Warning - element can not be found :#" + ename );
+ Roo.debug && Roo.log("Warning - element can not be found :#" + ename );
return;
}
}
- Roo.log("EL:");Roo.log(el);
- Roo.log("this.parent.el:");Roo.log(this.parent.el);
+ Roo.debug && Roo.log("EL:");
+ Roo.debug && Roo.log(el);
+ Roo.debug && Roo.log("this.parent.el:");
+ Roo.debug && Roo.log(this.parent.el);
var tree = this._tree ? this._tree() : this.tree();
if (!this.parent) {
- Roo.log("no parent - creating one");
+ Roo.debug && Roo.log("no parent - creating one");
el = el ? Roo.get(el) : false;
}
}
- if (!this.parent.el) {
- // probably an old style ctor, which has been disabled.
- return;
-
- }
+ if (!this.parent.el) {
+ // probably an old style ctor, which has been disabled.
+ return;
+
+ }
// The 'tree' method is '_tree now'
tree.region = tree.region || this.region;
this.panel = this.el;
this.layout = this.panel.layout;
- this.parentLayout = this.parent.layout || false;
+ this.parentLayout = this.parent.layout || false;
}
try {
obj.parent = this.toObject(opar);
} catch(e) {
- Roo.log("parent:toObject failed: " + e.toString());
+ Roo.debug && Roo.log("parent:toObject failed: " + e.toString());
return;
}
return;
}
if (obj.parent.constructor != Roo.XComponent) {
- Roo.log("Warning : Object Parent is not instance of XComponent:" + obj.name)
+ Roo.debug && Roo.log("Warning : Object Parent is not instance of XComponent:" + obj.name)
}
if (!obj.parent.modules) {
obj.parent.modules = new Roo.util.MixedCollection(false,