Widget-Modality.js revision e7a8cf714fd2334c7ca3ccf2fcfac3163964ddd4
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) {
if (visible) {
});
// push on top of stack
this._attachUIHandles();
this._repositionMask(host);
this._focus();
} else {
this._detachUIHandles();
this._blur();
} else {
}
}
},
_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: []
});
}());