changeset 699:d33bedc3be74

Merge private messages fix with current development of S3 photo upload.
author Brian Neal <bgneal@gmail.com>
date Mon, 09 Sep 2013 20:53:08 -0500
parents 67f8d49a9377 (current diff) efb525863a75 (diff)
children e888d627928f
files
diffstat 1 files changed, 8 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/messages/static/js/tabbed_messages.js	Sun Sep 08 21:02:58 2013 -0500
+++ b/messages/static/js/tabbed_messages.js	Mon Sep 09 20:53:08 2013 -0500
@@ -12,18 +12,13 @@
    }));
 
    $tabs = $('#tabs').tabs({
-      selected: initialTab,
-      select: function(event, ui) {
+      active: initialTab,
+      activate: function(event, ui) {
          $(ui.panel).html('');
       },
       load: function(event, ui) {
          selectedTab = ui;
-         if (ui.index == 1 && receiver && !doReply)
-         {
-            $('#id_receiver').val(receiver);
-            receiver = '';
-         }
-         else if (doReply && ui.index == 1)
+         if (doReply && ui.tab.index() == 1)
          {
             doReply = false;
             var msg = msgCache[$msgDialog.msgId];
@@ -34,11 +29,11 @@
                $msgDialog.msgId + '" />');
          }
       },
-      ajaxOptions: {
-         error: function(xhr, status, index, anchor) {
+      beforeLoad: function(event, ui) {
+         ui.jqXHR.error(function(xhr, status, index, anchor) {
             $(anchor.hash).html(
                "Oops, we couldn't load this tab. We'll try to fix this as soon as possible.");
-         }
+         });
       }
    });
    $msgDialog = $('#msgDialog').dialog({
@@ -53,7 +48,7 @@
             click: function() { 
                doReply = true;
                $(this).dialog('close'); 
-               $tabs.tabs("select", 1);
+               $tabs.tabs("option", "active", 1);
             } 
          },
          { 
@@ -183,7 +178,7 @@
          data: $(form).serialize(),
          dataType: 'text',
          success: function (data, textStatus) {
-            $tabs.tabs("load", selectedTab.index);
+            $tabs.tabs("load", selectedTab.tab.index());
          },
          error: function (xhr, textStatus, ex) {
             alert('Oops, an error occurred. ' + xhr.statusText + ' - ' +