From 0443d63e7e0f875986699b13e20f44ea9460a1fb Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 30 Mar 2007 05:14:00 +0000 Subject: fix #564, take 3 --- .../protected/controls/Comments/comments.js | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'demos/quickstart/protected/controls/Comments') diff --git a/demos/quickstart/protected/controls/Comments/comments.js b/demos/quickstart/protected/controls/Comments/comments.js index 75cbd482..68e9ae7d 100644 --- a/demos/quickstart/protected/controls/Comments/comments.js +++ b/demos/quickstart/protected/controls/Comments/comments.js @@ -173,7 +173,7 @@ function get_comment_count(id) if(!Prado.Browser.ie) //not IE 4,5,6 { - Event.OnLoad(function() + (function() { var userComments = $('user-comments'); userComments.style.position="absolute"; @@ -191,17 +191,19 @@ if(!Prado.Browser.ie) //not IE 4,5,6 $$('#comment-list .source-link').each(function(el){ el.hide(); }); - $$('#content .block-content').each(function(el) + Event.OnLoad(function() //delay the event registration of mouse { - Event.observe(el, 'mouseover', function(e){ if(typeof(show_block)!="undefined") show_block(Event.element(e)); }); - Event.observe(el, 'mouseout', function(e){ if(typeof(hide_block)!="undefined") hide_block(Event.element(e)); }); - add_comment_tag(el); + $$('#content .block-content').each(function(el) + { + Event.observe(el, 'mouseover', function(e){ if(typeof(show_block)!="undefined") show_block(Event.element(e)); }); + Event.observe(el, 'mouseout', function(e){ if(typeof(hide_block)!="undefined") hide_block(Event.element(e)); }); + add_comment_tag(el); + }); + + Event.observe($('show-comment-link'), "click", function(e) { show_comment_list(); Event.stop(e); }); + Event.observe($('add-comment-link'), "click", function(e) { show_add_comment(); Event.stop(e); }); + Event.observe($('all-comments-link'), "click", function(e) { show_all_comments(); Event.stop(e); }); + Event.observe($('close-comments'), "click", function(e) { hide_add_comment(); Event.stop(e); }); }); - - Event.observe($('show-comment-link'), "click", function(e) { show_comment_list(); Event.stop(e); }); - Event.observe($('add-comment-link'), "click", function(e) { show_add_comment(); Event.stop(e); }); - Event.observe($('all-comments-link'), "click", function(e) { show_all_comments(); Event.stop(e); }); - Event.observe($('close-comments'), "click", function(e) { hide_add_comment(); Event.stop(e); }); - - }); + })(); } \ No newline at end of file -- cgit v1.2.3