From: <mp...@kr...> - 2007-03-30 14:52:32
|
Revision: 3678 Author: mpeters Date: 2007-03-30 09:52:19 -0500 (Fri, 30 Mar 2007) Log Message: ----------- show the alerts/messages first so the user can read them while we apply the behaviors; also fix bug in Krang.Messages.show() where we were comparing i to my_stack.length, but were also popping thing off the stack, so it would shrink and only show half of the items Modified Paths: -------------- branches/ajax_and_new_skin/htdocs/js/krang.js Property Changed: ---------------- branches/ajax_and_new_skin/ Property changes on: branches/ajax_and_new_skin ___________________________________________________________________ Name: svk:merge - 6cb60ec2-19fc-4f48-ba02-516b4c84136d:/local/krang_ajax_and_new_skin:28035 + 6cb60ec2-19fc-4f48-ba02-516b4c84136d:/local/krang_ajax_and_new_skin:28036 Modified: branches/ajax_and_new_skin/htdocs/js/krang.js =================================================================== --- branches/ajax_and_new_skin/htdocs/js/krang.js 2007-03-30 14:52:08 UTC (rev 3677) +++ branches/ajax_and_new_skin/htdocs/js/krang.js 2007-03-30 14:52:19 UTC (rev 3678) @@ -16,6 +16,10 @@ for which to apply the behaviors. */ Krang.load = function(target) { + // show the messages and alerts if there are any + Krang.Messages.show(); + Krang.Messages.show('alerts'); + // apply our registered behaviours Behaviour.apply(target); @@ -24,10 +28,6 @@ var code = Krang.onload_code.pop(); if( code ) code(); } - - // show the messages and alerts if there are any - Krang.Messages.show(); - Krang.Messages.show('alerts'); }; /* @@ -497,7 +497,8 @@ var my_stack = Krang.Messages.stack[level]; if( my_stack.length ) { var content = ''; - for(var i=0; i< my_stack.length; i++) { + var size = my_stack.length; + for(var i=0; i< size; i++) { var msg = my_stack.pop(); if( msg ) content = content + '<p>' + msg + '</p>'; } |