Description:
fixed announcement refresh bug when initially there was no announcement
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r226:4488d204f427 - - 2 files changed: 8 inserted, 4 deleted
@@ -1,11 +1,10 | |||
|
1 | 1 | - content_for :head do |
|
2 | 2 | = javascript_include_tag :defaults |
|
3 | - %script{:type => 'text/javascript', :src => '/javascripts/announcement_refresh.js'} | |
|
3 | + = javascript_include_tag 'announcement_refresh.js' | |
|
4 | 4 | |
|
5 | 5 | = user_title_bar(@user) |
|
6 | 6 | |
|
7 | - - if @announcements.length!=0 | |
|
8 | - .announcementbox | |
|
7 | + .announcementbox{:style => (@announcements.length==0 ? "display:none" : "")} | |
|
9 | 8 |
|
|
10 | 9 |
|
|
11 | 10 |
|
@@ -18,8 +18,13 | |||
|
18 | 18 | method: 'get', |
|
19 | 19 | parameters: { recent: Announcement.mostRecentId }, |
|
20 | 20 | onSuccess: function(transport) { |
|
21 | + if(transport.responseText.match(/\S/)!=null) { | |
|
21 | 22 |
var announcementBody = |
|
22 | 23 | announcementBody.insert({ top: transport.responseText }); |
|
24 | + var announcementBoxes = $$(".announcementbox"); | |
|
25 | + if(announcementBoxes.length!=0) | |
|
26 | + announcementBoxes[0].show(); | |
|
27 | + } | |
|
23 | 28 | } |
|
24 | 29 | }); |
|
25 | 30 | Announcement.registerRefreshEventTimer(); |
@@ -30,4 +35,4 | |||
|
30 | 35 | Announcement.refreshAnnouncement(); |
|
31 | 36 | }, 30000); |
|
32 | 37 | } |
|
33 | - }; No newline at end of file | |
|
38 | + }; |
You need to be logged in to leave comments.
Login now