widget-modality.js revision c0e4b72550a9206a3094dbc43e95ee297b863bf9
var WIDGET = 'widget',
HOST = 'host',
RENDER_UI = 'renderUI',
BIND_UI = 'bindUI',
SYNC_UI = 'syncUI',
RENDERED = 'rendered',
BOUNDING_BOX = 'boundingBox',
CONTENT_BOX = 'contentBox',
VISIBLE = 'visible',
Z_INDEX = 'zIndex',
ALIGN = 'align',
CHANGE = 'Change',
supportsPosFixed = (function(){
/*! IS_POSITION_FIXED_SUPPORTED - Juriy Zaytsev (kangax) - http://yura.thinkweb2.com/cft/ */
var isSupported = null,
if (document.createElement) {
}
}
}
return isSupported;
}()),
(function(){
var WIDGET_MODAL = 'widgetModal',
MODAL = 'modal',
MASK = 'mask',
MODAL_CLASSES = {
};
// *** Instance Members *** //
_maskNode : null,
_uiHandles : null,
// *** Lifecycle Methods *** //
initializer : function (config) {
var self = this;
this.renderUI();
this.bindUI();
this.syncUI();
}
},
destructor : function () {
if (this._maskNode) {
}
this._detachUIHandles();
},
renderUI : function () {
//this makes the content box content appear over the mask
position: "relative"
});
},
bindUI : function () {
},
syncUI : function () {
},
// *** Private Methods *** //
_focus : function (e) {
//Y.later(0, host, 'focus');
//this._detachUIHandles();
//host.focus();
//bb.set('tabIndex', oldTI);
},
_blur : function () {
},
_getMaskNode : function () {
return WidgetModal._GET_MASK();
},
_uiSetHostVisible : function (visible) {
var self = this,
//whatever is at the top of the stack receives focus, everything else is blurred.
//in this case, the element is visible, so it goes to the top of stack and gets focus
if (visible) {
//blur everything in the stack
for (var i = 0; i < len; i++) {
}
//push the current instance to top of stack
});
//attach ui handles to the current element, show mask, and focus
this._attachUIHandles();
this._focus();
}
//if it just lost visibility (was hidden)
else {
//pop the hidden element off the stack.
//pop the hidden element off the stack.
//detach UI handles and blur it.
o.modal._detachUIHandles();
}
}
//if nothing else is in the stack, then hide the mask
}
//if something else is on the stack, it means it's still visible (behind the element that was just hidden)
//in this case, go to the next thing on the stack, and reposition the mask behind it
else {
this._repositionMask(host);
//host.modal.syncUI();
}
}
},
_uiSetHostZIndex : function (zIndex) {
},
_attachUIHandles : function (modal) {
if (this._uiHandles) { return; }
this._uiHandles = [
];
if ( ! supportsPosFixed) {
}, this)));
}
},
_detachUIHandles : function () {
Y.each(this._uiHandles, function(h){
h.detach();
});
this._uiHandles = null;
},
_afterHostVisibleChange : function (e) {
this._uiSetHostVisible(e.newVal);
},
_afterHostZIndexChange : function (e) {
this._uiSetHostZIndex(e.newVal);
},
_isNested: function() {
var m = WidgetModal._GET_MASK();
},
//w is the host behind which mask should be repositioned
_repositionMask: function(host) {
//get rid of the mask and reposition it behind the last element in the stack
}
}, {
// *** Static *** //
ATTRS : {
maskNode : {
getter : '_getMaskNode',
readOnly : true
},
node: {
}
},
//Returns the mask if it exists on the page - otherwise creates a mask. There's only
//one mask on a page at a given time.
_GET_MASK: function() {
if (mask) {
return mask;
}
else {
width : '100%',
height : '100%',
top : '0',
left : '0',
display : 'block'
});
return mask;
}
},
//associative array of objects
STACK: []
});
}());