Widget-Autohide.js revision 853244a9af0549d584b80ac65d4fcb92de7c58bc
var WIDGET_AUTOHIDE = 'widgetAutohide',
AUTOHIDE = 'autohide',
CLICKED_OUTSIDE = 'clickedOutside',
FOCUSED_OUTSIDE = 'focusedOutside',
PRESSED_ESCAPE = 'pressedEscape',
BIND_UI = 'bindUI',
SYNC_UI = "syncUI",
RENDERED = "rendered",
BOUNDING_BOX = "boundingBox",
VISIBLE = "visible",
HOST = "host",
CHANGE = 'Change',
// *** Instance Members *** //
_uiHandles : null,
// *** Lifecycle Methods *** //
initializer : function (config) {
this.bindUI();
this.syncUI();
}
},
destructor : function () {
this._detachUIHandles();
},
bindUI : function () {
},
syncUI : function () {
},
// *** Private Methods *** //
_uiSetHostVisible : function (visible) {
if (visible) {
//this._attachUIHandles();
} else {
this._detachUIHandles();
}
},
_attachUIHandles : function () {
if (this._uiHandles) { return; }
uiHandles = [];
if (this.get(CLICKED_OUTSIDE)) {
}
if (this.get(FOCUSED_OUTSIDE)) {
}
if (this.get(PRESSED_ESCAPE)) {
}
this._uiHandles = uiHandles;
},
_detachUIHandles : function () {
Y.each(this._uiHandles, function(h){
h.detach();
});
this._uiHandles = null;
},
_afterHostVisibleChange : function (e) {
this._uiSetHostVisible(e.newVal);
}
}, {
// *** Static *** //
ATTRS : {
clickedOutside : {
value : false,
},
focusedOutside : {
value : false,
},
pressedEscape : {
value : true,
}
}
});