diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-02-20 13:52:58 -0300 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-02-20 13:52:58 -0300 |
commit | cd77b90e074fdf11ca09a9030a99837605fd56aa (patch) | |
tree | 51d2899d2699273db4e84461c3385e46ee9a9b8e | |
parent | e98c5d82d4c1383a055f043bf090f125e2ccc275 (diff) | |
download | askbot-cd77b90e074fdf11ca09a9030a99837605fd56aa.tar.gz askbot-cd77b90e074fdf11ca09a9030a99837605fd56aa.tar.bz2 askbot-cd77b90e074fdf11ca09a9030a99837605fd56aa.zip |
prevented double click on the threads load in personal messages
-rw-r--r-- | askbot/media/js/group_messaging.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/askbot/media/js/group_messaging.js b/askbot/media/js/group_messaging.js index c4d5ee74..30519f1f 100644 --- a/askbot/media/js/group_messaging.js +++ b/askbot/media/js/group_messaging.js @@ -610,6 +610,7 @@ SendersList.prototype.decorate = function(element) { */ var MessageCenter = function() { Widget.call(this); + this._loadingStatus = false;//true when loading in is process }; inherits(MessageCenter, Widget); @@ -649,7 +650,14 @@ MessageCenter.prototype.setThreadsList = function(list) { this._secondCol.prepend(list.getElement()); }; +MessageCenter.prototype.setLoadingStatus = function(loadingStatus) { + this._loadingStatus = loadingStatus; +}; + MessageCenter.prototype.hitThreadsList = function(url, senderId, requestMethod) { + if (this._loadingStatus === true) { + return; + }; var threadsList = this._threadsList; var me = this; $.ajax({ @@ -666,9 +674,14 @@ MessageCenter.prototype.hitThreadsList = function(url, senderId, requestMethod) threads.decorate($(data['html'])); me.setThreadsList(threads); me.setState('show-list'); + me.setLoadingStatus(false); + }, + error: function() { + me.setLoadingStatus(false); } } }); + this.setLoadingStatus(true); }; MessageCenter.prototype.deleteOrRestoreThread = function(threadId, senderId) { |