ipsGlobalNotification needs to hide or update rather than fade when triggered while visible
Submitted Marcher Technologies, Aug 23 2012 12:07 AM | Last updated Oct 17 2012 10:24 AM
or check that the element still exists in Fade, which is not as feasible:
TypeError: element is undefined
public/js/3rd_party/scriptaculous/scriptaculous-cache.js
Line 598
Effect.Fade = function(element) {
element = $(element);
var oldOpacity = element.getInlineOpacity();
Otherwise it will do that, trying to fade it out rather than replace it and update the timer or simply hiding it before fading back in causes a Javascript error.
| Status: | Fixed |
| Version: | 3.3.4 |
| Fixed In: | 3.4.0 |











11 Comments
/* Already one open? */ if ( $('ipsGlobalNotification' ) ) { var span = $('ipsGlobalNotification').down('span'); /* fade out current content and fade in new */ new Effect.Fade( span, { duration: 0.8, afterFinish: function() { span.replace( new Element( 'span' ).update( content ) ); new Effect.Appear( $('ipsGlobalNotification').down('span'), { duration: 0.8 } ); } } ); }ergo, at that instant it is on-screen, but not visible or is 'fading', the js err pops.... seems more wise to fade it out(the whole notification)actually remove it and make a new one fade in frankly.... thinking its the inability to down to the span as the notification is not visible./* Already one open? */ if ( $('ipsGlobalNotification' ) ) { var span = $('ipsGlobalNotification').down('span'); if(!span){return;}Would be the cheap fix similar to what I’m doing in my js.Updating Version to: 3.3.4
I'm having difficulty following what you are trying to explain. Could you please post steps to reproduce this issue so I can see it first hand?
<span id='globalNotifyTester' class='ipsButton'> Click me </span> <script type='text/javascript'> document.observe("dom:loaded", function(){ $('globalNotifyTester').observe('click', function() { var rand = Math.random(); ipb.global.showInlineNotification( rand ); }); }); </script>Also.... as far as I can see its not being updated properly anyway, hence why everybody has code stopping input when visible.1) open user menu and update staus (inline alert appears)
2) open menu again and update before inline alert fades out.
http://screencast.com/t/WFFYTcHz1wS
What am I missing?
is evil to reproduce frankly, but i have hit it often enough in ajax calls to make me stop the fire when that is visible.
Can I just change what this report is about?
try the above code, the span is factually not updating properly with the new message... causes this sort of stuttering effect whereby only the first message is shown.
I suppose this would be better titled kill it(the element/timeout/reference) and make a new one, it is just not updating the message properly.
-
Either the code attempting to update the notification is unnecessary and should be removed if it was never meant to, or it should be changed to update properly.
OK so what you're saying is if the inline global notification message is triggered and then something else triggers it with different text then the new message will not show?
Updating Status to: Fixed
OK, what will happen now is this:
- First notification shows up
- Another one fires while the first is open, so the first fades out immediately, and the second appears afterwards
- The second is visible for the normal length of time