widget-modality.js revision d0546aecb66110c4b0bc1d8336b7621ed3dd9993
var WIDGET = 'widget',
HOST = 'host',
RENDER_UI = 'renderUI',
BIND_UI = 'bindUI',
SYNC_UI = 'syncUI',
RENDERED = 'rendered',
BOUNDING_BOX = 'boundingBox',
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) {
this.renderUI();
this.bindUI();
this.syncUI();
}
},
destructor : function () {
if (this._maskNode) {
}
this._detachUIHandles();
},
renderUI : function () {
//Y.one('body').setStyle('background', 'rgba(0,0,0,0.5)');
// this._maskNode = Y.Node.create('<div></div>');
// this._maskNode.addClass(MODAL_CLASSES.mask);
// this._maskNode.setStyles({
// position : supportsPosFixed ? 'fixed' : 'absolute',
// width : '100%',
// height : '100%',
// top : '0',
// left : '0',
// display : 'none'
// });
// bbParent.insert(this._maskNode, bbParent.get('firstChild'));
// bb.addClass(MODAL_CLASSES.modal);
// this._maskNode = Y.Node.create('<div></div>');
// this._maskNode.addClass(MODAL_CLASSES.mask);
// this._maskNode.setStyles({
// position : supportsPosFixed ? 'fixed' : 'absolute',
// width : area.get('offsetWidth'),
// height : area.get('offsetHeight'),
// top : area.get('top'),
// left : area.get('left'),
// display : 'none'
// });
//bbParent.insert(this._maskNode, bbParent.get('firstChild'));
// this.get(HOST).on('visibleChange', function(e) {
// Y.one('#important').setStyle('background', 'rgba(255,255,255,1)');
// });
},
bindUI : function () {
},
syncUI : function () {
},
// *** Private Methods *** //
_allowFocus: function() {
var a = ['#special'];
for (var i = 0; i < a.length; i++){
}
},
_focus : function (e) {
},
_blur : function () {
},
_getMaskNode : function () {
return this._maskNode;
},
_uiSetHostVisible : function (visible) {
if (visible) {
//this._maskNode.setStyle('display', 'block');
this._focus();
} else {
this._detachUIHandles();
//this._maskNode.setStyle('display', 'none');
this._blur();
}
},
_uiSetHostZIndex : function (zIndex) {
//this._maskNode.setStyle(Z_INDEX, zIndex || 0);
},
_attachUIHandles : function (modal) {
if (this._uiHandles) { return; }
this._uiHandles = [
];
if ( ! supportsPosFixed) {
//maskNode.setStyle('top', maskNode.get('docScrollY'));
}, 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);
}
}, {
// *** Static *** //
ATTRS : {
maskNode : {
getter : '_getMaskNode',
readOnly : true
},
node: {
}
},
});
}());