Widget-Stack.js revision f7d92e8be534f4df53336784ce256933d6375ac6
/**
* @module widget-stack
*/
var L = Y.Lang,
ZINDEX = "zIndex",
SHIM = "shim",
VISIBLE = "visible",
BOUNDING_BOX = "boundingBox",
RENDER_UI = "renderUI",
BIND_UI = "bindUI",
SYNC_UI = "syncUI",
OFFSET_WIDTH = "offsetWidth",
OFFSET_HEIGHT = "offsetHeight",
WIDTH = "width",
HEIGHT = "height",
PX = "px",
// HANDLE KEYS
SHIM_DEFERRED = "shimdeferred",
SHIM_RESIZE = "shimresize",
// Events
VisibleChange = "visibleChange",
WidthChange = "widthChange",
HeightChange = "heightChange",
ShimChange = "shimChange",
ZIndexChange = "zIndexChange",
ContentUpdated = "contentUpdated",
// CSS
STACKED = "stacked",
SHOW_SCROLLBARS = "show-scrollbars",
HIDE_SCROLLBARS = "hide-scrollbars";
/**
* @class WidgetStack
*/
this._stackHandles = {};
// WIDGET METHOD OVERLAP
}
// Static Properties
shim: {
},
zIndex: {
value:0,
return this._setZIndex(val);
}
}
};
Stack.HTML_PARSER = {
zIndex: function(contentBox) {
}
};
Stack.SHIM_TEMPLATE = '<iframe class="' + Stack.SHIM_CLASS + '" frameborder="0" title="Widget Stacking Shim" src="javascript:false"></iframe>';
_syncUIStack: function() {
},
_bindUIStack: function() {
},
_renderUIStack: function() {
// TODO:DEPENDENCY Env.os
this._fixMacGeckoScrollbars();
}
},
_setZIndex: function(zIndex) {
}
zIndex = 0;
}
return zIndex;
},
_onShimChange : function(e) {
this._uiSetShim(e.newVal);
},
_onZIndexChange : function(e) {
this._uiSetZIndex(e.newVal);
},
_uiSetZIndex: function (zIndex) {
},
_uiSetShim: function (enable) {
if (enable) {
// Lazy creation
this._renderShim();
} else {
this._renderShimDeferred();
}
} else {
this._destroyShim();
}
},
_renderShimDeferred : function() {
createBeforeVisible = function(e) {
if (e.newVal) {
this._renderShim();
}
};
},
_addShimResizeHandlers : function() {
this.sizeShim();
},
_detachStackHandles : function(handleKey) {
if (handles) {
delete handles[i];
}
}
},
_renderShim : function() {
stackEl = this._stackNode;
if (!shimEl) {
this._addShimResizeHandlers();
}
this._detachStackHandles(SHIM_DEFERRED);
}
},
_destroyShim : function() {
if (this._shimNode) {
this._shimNode = null;
this._detachStackHandles(SHIM_DEFERRED);
this._detachStackHandles(SHIM_RESIZE);
}
},
_fixMacGeckoScrollbars: function() {
this._toggleMacGeckoScrollbars();
},
_toggleMacGeckoScrollbars : function() {
this._showMacGeckoScrollbars();
} else {
this._hideMacGeckoScrollbars();
}
},
_hideMacGeckoScrollbars: function () {
this._stackNode.replaceClass(Widget.getClassName(SHOW_SCROLLBARS), Widget.getClassName(HIDE_SCROLLBARS));
},
_showMacGeckoScrollbars: function () {
this._stackNode.replaceClass(Widget.getClassName(HIDE_SCROLLBARS), Widget.getClassName(SHOW_SCROLLBARS));
},
/**
* For IE6, synchronizes the size and position of iframe shim to that of
* Widget bounding box which it is protecting. For all other browsers,
* this method does not do anything.
*
* @method sizeIframe
*/
sizeShim: function () {
node = this._stackNode;
}
},
_getShimTemplate : function() {
if (!Stack._SHIM_TEMPLATE) {
}
}
};
Y.WidgetStack = Stack;