Switch back to 'Home' view when composing new message.

For now the idea is that if you're in the search view (or the
subscriptions view) and you click 'New Message', we should
snap you back to the main view.

This may or may not be the right behavior in the long term.

(imported from commit 43c24e1af9e80225ff9be8a62f4c8c925960436a)
This commit is contained in:
Waseem Daher 2012-09-17 13:07:59 -04:00
parent 6a7c2b3ef7
commit 5ebac29508
2 changed files with 8 additions and 3 deletions

View File

@ -46,7 +46,7 @@ var people_list = {{ people }};
<div class="row-fluid">
<div class="span3">
<div class="zephyr_well well sidebar-nav">
<ul class="nav nav-pills nav-stacked nav-zephyr">
<ul class="nav nav-pills nav-stacked nav-zephyr" id="sidebar">
<span class="my_fullname">{{ user_profile.full_name }}</span><br/>
<span class="my_email">{{ user_profile.email }}</span>
<span class="logout">(<a href="/accounts/logout?next=/">not you?</a>)</span>
@ -54,9 +54,9 @@ var people_list = {{ people }};
<li><a href="subscriptions/">Manage subscriptions</a></li>
<li class="disabled"><a href="#">View starred messages</a></li>
<li><a href="#search" data-toggle="pill">Search</a></li>
<li><a href="#">Invite a friend</a></li>
<li class="disabled"><a href="#">Invite a friend</a></li>
<br>
<a href="#" class="btn btn-large btn-block button-slide">New Message</a>
<a href="#" class="btn btn-large btn-block" id="new_message_button" onclick="compose_button()">New Message</a>
</ul>
</div><!--/.well -->
</div><!--/span-->

View File

@ -70,6 +70,11 @@ function sub(zephyr_class) {
$.post('/subscriptions/add/', {new_subscriptions: zephyr_class});
}
function compose_button() {
$('#sidebar a[href="#home"]').tab('show');
show_compose();
}
function hide_compose() {
$('input, textarea, button').blur();
$('.zephyr_compose').slideUp('fast');