Skip to content

Commit

Permalink
Fix setting title
Browse files Browse the repository at this point in the history
  • Loading branch information
daleharvey committed Feb 18, 2012
1 parent 3bc91e6 commit 69e93a8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions public/js/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

$("#main-title.changeling").bind("click", function () {
if ($(this).is(":not(.editing)")) {
title = $('h3', this).text();
title = $.trim($('h3', this).text());
$(this).addClass("editing");
$('h3', this).empty().append(tpl);
var input = $(this).find("#title-input");
Expand Down Expand Up @@ -32,7 +32,7 @@

$("#save-title").live("click", function () {
var newTitle = $("#title-input").val();
var data = "title=" + newTitle;
var data = "title=" + encodeURIComponent(newTitle);
data += isThread() ? "&thread_id=" + thread.id() : '';

$.ajax({
Expand Down Expand Up @@ -215,10 +215,10 @@ function isThread() {
e.preventDefault();
$('#login-box').html(defaultLoginBox);
});

$('#hide-ads').live('click', function(e){
e.preventDefault();

$.ajax({
url: '/ajax/hide_ads/'+session_id,
success: function(data){
Expand All @@ -227,16 +227,16 @@ function isThread() {
}
});
});

$('#unhide-ads').live('click', function(e){
e.preventDefault();

$.ajax({
url: '/ajax/show_ads/'+session_id,
success: function(data){
if (data == 1)
if (data == 1)
window.location.reload(false);
window.location.reload(false);
}
});
});
Expand Down

0 comments on commit 69e93a8

Please sign in to comment.