r92940 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92939‎ | r92940 | r92941 >
Date:11:40, 23 July 2011
Author:zhenya
Status:ok
Tags:
Comment:
fixed bug when History cannot be opened after saving the status.
Also was reduced the amount of AJAX calls during the session.
Modified paths:
  • /trunk/extensions/SocialProfile/UserStatus/UserStatus.js (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserStatus/UserStatus.js
@@ -1,5 +1,4 @@
22 var UserStatus = {
3 - historyOpened : false,
43 maxStatusLength : 70,
54
65 toShowMode: function( status, id ) {
@@ -35,31 +34,22 @@
3635 },
3736
3837 useHistory: function( id ){
39 - if (this.historyOpened) {
40 - this.closeStatusHistory();
41 - } else {
42 - this.openStatusHistory(id);
43 - }
44 - },
45 -
46 - openStatusHistory: function( id ) {
4738 var historyBlock = document.getElementById('status-history-block');
4839 if(historyBlock===null) {
4940 var statusBlock = document.getElementById('user-status-block');
5041 historyBlock = document.createElement('div');
5142 historyBlock.id = 'status-history-block';
5243 statusBlock.appendChild(historyBlock);
 44+ sajax_do_call( 'wfGetHistory', [id], historyBlock );
5345 }
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+ }
5652 },
5753
58 - closeStatusHistory: function() {
59 - var hBlock = document.getElementById('status-history-block');
60 - hBlock.parentNode.removeChild(hBlock);
61 - this.historyOpened = false;
62 - },
63 -
6454 fromHistoryToStatus: function( str ) {
6555 document.getElementById('user-status-input').value = str;
6656 }

Status & tagging log