From 29b39739df3393f138dbdd98591e1331af0393ad Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Thu, 04 Nov 2010 09:48:17 -0400
Subject: [PATCH] - Improve responsiveness of messages displaying (#1486986)

---
 program/js/app.js |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/program/js/app.js b/program/js/app.js
index 30eaef5..13711ff 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -210,11 +210,9 @@
           this.enable_command(this.env.message_commands, this.env.uid);
           this.enable_command('reply-list', this.env.list_post);
 
-          if (this.env.next_uid) {
-            this.enable_command('nextmessage', 'lastmessage', true);
-          }
-          if (this.env.prev_uid) {
-            this.enable_command('previousmessage', 'firstmessage', true);
+          if (this.env.action == 'show') {
+            this.http_request('pagenav', '_uid='+this.env.uid+'&_mbox='+urlencode(this.env.mailbox),
+              this.display_message('', 'loading'));
           }
 
           if (this.env.blockedobjects) {
@@ -4595,10 +4593,15 @@
     var date = new Date(),
       id = type + date.getTime();
 
-    // The same message of type 'loading' is already displayed
-    if (type == 'loading' && this.messages[msg]) {
-       this.messages[msg].elements.push(id);
-       return id;
+    if (type == 'loading') {
+      if (!msg)
+        msg = this.get_label('loading');
+
+      // The same message of type 'loading' is already displayed
+      if (this.messages[msg]) {
+        this.messages[msg].elements.push(id);
+        return id;
+      }
     }
 
     var ref = this,

--
Gitblit v1.9.1