things having to do with publisher belong in publisher.js not stream.js

This commit is contained in:
Dan Hansen 2011-01-29 14:42:59 -06:00
parent d03119f7e9
commit 7089782ba1
2 changed files with 31 additions and 19 deletions

View file

@ -5,6 +5,8 @@
$(document).ready(function(){
var $publisher = $("#publisher");
$("div.public_toggle input").live("click", function(evt){
$("#publisher_service_icons").toggleClass("dim");
if($(this).attr('checked') == true){
@ -12,18 +14,37 @@ $(document).ready(function(){
};
});
if($("textarea#status_message_message").val() != ""){
$("#publisher").removeClass("closed");
$("#publisher").find("textarea").focus();
$("#publisher .options_and_submit").show();
if($("#status_message_message").val() != ""){
$publisher
.removeClass("closed");
.find("textarea")
.focus();
$publisher
.find(".options_and_submit")
.show();
}
$("#publisher textarea").live("focus", function(evt){
$("#publisher .options_and_submit").show();
$publisher.find("textarea").live("focus", function(evt){
$publisher.find(".options_and_submit").show();
});
$("#publisher textarea").live("click", function(evt){
$("#publisher").removeClass("closed");
$("#publisher").find("textarea").focus();
$publisher.find("textarea").live("click", function(evt){
$publisher
.removeClass("closed")
.find("textarea")
.focus();
});
$publisher.find("textarea").bind("focus", function() {
$(this)
.css('min-height','42px');
});
$publisher.find("form").bind("blur", function() {
$publisher
.find("textarea")
.css('min-height','2px');
});
});

View file

@ -6,19 +6,10 @@
var Stream = {
initialize: function() {
var $stream = $(".stream");
var $publisher = $("#publisher");
$("abbr.timeago").timeago();
$stream.not(".show").delegate("a.show_post_comments", "click", Stream.toggleComments);
// publisher textarea reset
$publisher.find("textarea").bind("focus", function() {
$(this).css('min-height','42px');
});
$publisher.find("form").bind("blur", function() {
$("#publisher textarea").css('min-height','2px');
});
// comment link form focus
$stream.delegate(".focus_comment_textarea", "click", function(e){
Stream.focusNewComment($(this), e);