widget-anim-debug.js revision e26236e4ee3c1c1cfed2f2c245cc9f2a8c7d4753
var BOUNDING_BOX = "boundingBox",
HOST = "host",
NODE = "node",
OPACITY = "opacity",
EMPTY_STR = "",
VISIBLE = "visible",
DESTROY = "destroy",
HIDDEN = "hidden",
RENDERED = "rendered",
START = "start",
END = "end",
DURATION = "duration",
ANIM_SHOW = "animShow",
ANIM_HIDE = "animHide",
_UI_SET_VISIBLE = "_uiSetVisible",
ANIM_SHOW_CHANGE = "animShowChange",
ANIM_HIDE_CHANGE = "animHideChange";
function WidgetAnim(config) {
}
/**
* The namespace for the plugin. This will be the property on the widget, which will
* reference the plugin instance, when it's plugged in
*/
/**
* The NAME of the WidgetAnim class. Used to prefix events generated
* by the plugin class.
*/
WidgetAnim.ANIMATIONS = {
fadeIn : function() {
});
// Set initial opacity, to avoid initial flicker
}
// Clean up, on destroy. Where supported, remove
// opacity set using style. Else make 100% opaque
});
return anim;
},
fadeOut : function() {
return new Y.Anim({
});
}
};
/**
* The default set of attributes for the WidgetAnim class.
*/
WidgetAnim.ATTRS = {
/**
* Default duration. Used by the default animation implementations
*/
duration : {
value: 0.2
},
/**
* Default animation instance used for showing the widget (opacity fade-in)
*/
animShow : {
},
/**
* Default animation instance used for hiding the widget (opacity fade-out)
*/
animHide : {
}
};
/**
* Extend the base plugin class
*/
/**
* Initialization code. Called when the
* plugin is instantiated (whenever it's
* plugged into the host)
*/
initializer : function(config) {
this._bindAnimShow();
this._bindAnimHide();
// Override default _uiSetVisible method, with custom animated method
},
/**
* Destruction code. Invokes destroy in the individual animation instances,
* and lets them take care of cleaning up any state.
*/
destructor : function() {
},
/**
* The custom animation method, added by the plugin.
*
* This method replaces the default _uiSetVisible handler
* Widget provides, by injecting itself before _uiSetVisible,
* (using Plugins before method) and preventing the default
* behavior.
*/
_uiAnimSetVisible : function(val) {
if (val) {
} else {
}
}
},
/**
* The original Widget _uiSetVisible implementation
*/
_uiSetVisible : function(val) {
},
/**
* Sets up call to invoke original visibility handling when the animShow animation is started
*/
_bindAnimShow : function() {
// Setup original visibility handling (for show) before starting to animate
Y.bind(function() {
this._uiSetVisible(true);
}, this));
},
/**
* Sets up call to invoke original visibility handling when the animHide animation is complete
*/
_bindAnimHide : function() {
// Setup original visibility handling (for hide) after completing animation
Y.bind(function() {
this._uiSetVisible(false);
}, this));
}
});