From cd77b90e074fdf11ca09a9030a99837605fd56aa Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Wed, 20 Feb 2013 13:52:58 -0300 Subject: prevented double click on the threads load in personal messages --- askbot/media/js/group_messaging.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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) { -- cgit v1.2.3-1-g7c22