# HG changeset patch # User Brian Neal # Date 1378777988 18000 # Node ID d33bedc3be74deff7689688c12ae9ea8eda46d0b # Parent 67f8d49a9377d1eaef853533b101d50c05893668# Parent efb525863a75bd105d740b682591ecf319be7f73 Merge private messages fix with current development of S3 photo upload. diff -r 67f8d49a9377 -r d33bedc3be74 messages/static/js/tabbed_messages.js --- 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 + ' - ' +