Index: trunk/extensions/SocialProfile/UserStatus/UserStatus.js |
— | — | @@ -1,5 +1,4 @@ |
2 | 2 | var UserStatus = { |
3 | | - historyOpened : false, |
4 | 3 | maxStatusLength : 70, |
5 | 4 | |
6 | 5 | toShowMode: function( status, id ) { |
— | — | @@ -35,31 +34,22 @@ |
36 | 35 | }, |
37 | 36 | |
38 | 37 | useHistory: function( id ){ |
39 | | - if (this.historyOpened) { |
40 | | - this.closeStatusHistory(); |
41 | | - } else { |
42 | | - this.openStatusHistory(id); |
43 | | - } |
44 | | - }, |
45 | | - |
46 | | - openStatusHistory: function( id ) { |
47 | 38 | var historyBlock = document.getElementById('status-history-block'); |
48 | 39 | if(historyBlock===null) { |
49 | 40 | var statusBlock = document.getElementById('user-status-block'); |
50 | 41 | historyBlock = document.createElement('div'); |
51 | 42 | historyBlock.id = 'status-history-block'; |
52 | 43 | statusBlock.appendChild(historyBlock); |
| 44 | + sajax_do_call( 'wfGetHistory', [id], historyBlock ); |
53 | 45 | } |
54 | | - this.historyOpened = true; |
55 | | - sajax_do_call( 'wfGetHistory', [id], historyBlock ); |
| 46 | + |
| 47 | + if (historyBlock.style.display == "block") { |
| 48 | + historyBlock.style.display = "none"; |
| 49 | + } else { |
| 50 | + historyBlock.style.display = "block"; |
| 51 | + } |
56 | 52 | }, |
57 | 53 | |
58 | | - closeStatusHistory: function() { |
59 | | - var hBlock = document.getElementById('status-history-block'); |
60 | | - hBlock.parentNode.removeChild(hBlock); |
61 | | - this.historyOpened = false; |
62 | | - }, |
63 | | - |
64 | 54 | fromHistoryToStatus: function( str ) { |
65 | 55 | document.getElementById('user-status-input').value = str; |
66 | 56 | } |