[pLog-svn] r5712 - plog/trunk/js/ui
mark at devel.lifetype.net
mark at devel.lifetype.net
Tue Jul 24 14:06:48 EDT 2007
Author: mark
Date: 2007-07-24 14:06:48 -0400 (Tue, 24 Jul 2007)
New Revision: 5712
Modified:
plog/trunk/js/ui/contentoverlay.js
Log:
A improved version of contentoverlay.js
1. centering is fixed in this version
2. remove home-made animation, I replace it with standard YUI container effect.
Modified: plog/trunk/js/ui/contentoverlay.js
===================================================================
--- plog/trunk/js/ui/contentoverlay.js 2007-07-24 15:46:36 UTC (rev 5711)
+++ plog/trunk/js/ui/contentoverlay.js 2007-07-24 18:06:48 UTC (rev 5712)
@@ -8,6 +8,7 @@
width:"660px",
close: true,
draggable: false,
+ effect:{effect:YAHOO.widget.ContainerEffect.FADE, duration: 0.25},
underlay:"shadow",
modal:true
}
@@ -20,91 +21,17 @@
Lifetype.UI.ContentOverlay.prototype.show = function()
{
- this.render( document.body );
-
c = YAHOO.util.Connect.asyncRequest( 'GET', this.url, { scope:this, success: function(o) {
- this.setBody( o.responseText )
+ this.setBody( o.responseText );
+ this.center();
}
});
+ this.render( document.body );
Lifetype.UI.ContentOverlay.superclass.show.call( this );
return( false );
}
-// Overrides the handler for the "modal" property with special animation-related functionality
-Lifetype.UI.ContentOverlay.prototype.configModal = function(type, args, obj)
-{
- var modal = args[0];
-
- if (modal) {
- this.buildMask();
-
- if (typeof this.maskOpacity == 'undefined') {
- this.mask.style.visibility = "hidden";
- this.mask.style.display = "block";
- this.maskOpacity = YAHOO.util.Dom.getStyle(this.mask,"opacity");
- this.mask.style.display = "none";
- this.mask.style.visibility = "visible";
- }
-
- if (! YAHOO.util.Config.alreadySubscribed( this.beforeShowEvent, this.showMask, this ) ) {
- this.beforeShowEvent.subscribe(this.showMask, this, true);
- }
- if (! YAHOO.util.Config.alreadySubscribed( this.hideEvent, this.hideMask, this) ) {
- this.hideEvent.subscribe(this.hideMask, this, true);
- }
- if (! YAHOO.util.Config.alreadySubscribed( YAHOO.widget.Overlay.windowResizeEvent, this.sizeMask, this ) ) {
- YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.sizeMask, this, true);
- }
- if (! YAHOO.util.Config.alreadySubscribed( this.destroyEvent, this.removeMask, this) ) {
- this.destroyEvent.subscribe(this.removeMask, this, true);
- }
- this.cfg.refireEvent("zIndex");
- }
- else {
- this.beforeShowEvent.unsubscribe(this.showMask, this);
- this.beforeHideEvent.unsubscribe(this.hideMask, this);
- YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.sizeMask);
- }
-};
-
-// Overrides the showMask function to allow for fade-in animation
-Lifetype.UI.ContentOverlay.prototype.showMask = function() {
- if (this.cfg.getProperty("modal") && this.mask) {
- YAHOO.util.Dom.addClass(document.body, "masked");
- this.sizeMask();
-
- var o = this.maskOpacity;
-
- if (! this.maskAnimIn) {
- this.maskAnimIn = new YAHOO.util.Anim(this.mask, {opacity: {to:o}}, 0.25)
- YAHOO.util.Dom.setStyle(this.mask, "opacity", 0);
- }
-
- if (! this.maskAnimOut) {
- this.maskAnimOut = new YAHOO.util.Anim(this.mask, {opacity: {to:0}}, 0.25)
- this.maskAnimOut.onComplete.subscribe(function() {
- this.mask.tabIndex = -1;
- this.mask.style.display = "none";
- this.hideMaskEvent.fire();
- YAHOO.util.Dom.removeClass(document.body, "masked");
- }, this, true);
-
- }
- this.mask.style.display = "block";
- this.maskAnimIn.animate();
- this.mask.tabIndex = 0;
- this.showMaskEvent.fire();
- }
-};
-
-// Overrides the showMask function to allow for fade-out animation
-Lifetype.UI.ContentOverlay.prototype.hideMask = function() {
- if (this.cfg.getProperty("modal") && this.mask) {
- this.maskAnimOut.animate();
- }
-};
-
/**
* Processes all the anchors whose "rel" attribute is set to
* "overlay". Can be called as static
More information about the pLog-svn
mailing list