Jump to content


Photo

ipsGlobalNotification needs to hide or update rather than fade when triggered while visible


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

Photo
Marcher Technologies
Aug 23 2012 12:07 AM
crud, 3.3.4, but id bet this would happen on any 3.2.x+... is a timing thing, currently and previously just making my Javascript do nothing if it is on-screen.... it is that Fade call doing it.
Photo
Marcher Technologies
Aug 23 2012 12:21 AM
/* 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 Status to: Awaiting Feedback
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?
Photo
Marcher Technologies
Aug 23 2012 04:52 AM

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?

update your status, open it again and update it before the notification fully fades... though what I am reporting is factually hard to hit... or just put this somewhere and click,
<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.
Yeah you've still lost me I'm afraid :smile:.

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?
Photo
Marcher Technologies
Aug 23 2012 10:19 PM
that the message must differ? timing?
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.
Updating Status to: Cannot Reproduce

-
Photo
Marcher Technologies
Sep 14 2012 08:30 AM
does the above code properly update the message for you? it not doing so(the message not updating, and thus stuttering) is consistently reproducible(at least in Firefox) in any usage that changes the message, you test with a static single message, correct?
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.
Updating Status to: Confirmed - Skin Issue

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?
    • Marcher Technologies likes this
Photo
Marcher Technologies
Sep 14 2012 09:09 AM
yes :smile: and general muckiness follows as a result.
Updating Fixed In to: 3.4.0
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

    • Marcher Technologies likes this