Fix title changing stuff

This commit is contained in:
Zixaphir 2014-01-09 21:30:48 -07:00
parent c47b14f0bf
commit d8a281c569
3 changed files with 25 additions and 16 deletions

View File

@ -11928,7 +11928,9 @@
Navigate.reconnect();
}
if (view === 'index') {
if (boardID !== g.BOARD.ID) {
if (boardID === g.BOARD.ID) {
d.title = $('.boardTitle').textContent;
} else {
Navigate.updateBoard(boardID);
}
return Index.update();
@ -12049,26 +12051,27 @@
}
} catch (_error) {
err = _error;
Main.handleErrors([
return Main.handleErrors([
{
message: "Navigation failed to update board name.",
error: err
}
]);
}
return Header.setBoardList();
};
Header.setBoardList();
return req = $.ajax('//a.4cdn.org/boards.json', {
onabort: onload,
onloadend: onload
});
},
updateTitle: function(board) {
var subtitle;
updateTitle: function(_arg) {
var board, subtitle, title;
board = _arg.board, title = _arg.title;
if (subtitle = $('.boardSubtitle')) {
$.rm(subtitle);
}
return $('.boardTitle').innerHTML = d.title = "/" + board.board + "/ - " + board.title;
return $('.boardTitle').textContent = d.title = "/" + board + "/ - " + title;
},
refresh: function(context) {
var boardID, feature, name, threadID, view, _i, _len, _ref, _ref1;

View File

@ -11917,7 +11917,9 @@
Navigate.reconnect();
}
if (view === 'index') {
if (boardID !== g.BOARD.ID) {
if (boardID === g.BOARD.ID) {
d.title = $('.boardTitle').textContent;
} else {
Navigate.updateBoard(boardID);
}
return Index.update();
@ -12040,26 +12042,27 @@
}
} catch (_error) {
err = _error;
Main.handleErrors([
return Main.handleErrors([
{
message: "Navigation failed to update board name.",
error: err
}
]);
}
return Header.setBoardList();
};
Header.setBoardList();
return req = $.ajax('//a.4cdn.org/boards.json', {
onabort: onload,
onloadend: onload
});
},
updateTitle: function(board) {
var subtitle;
updateTitle: function(_arg) {
var board, subtitle, title;
board = _arg.board, title = _arg.title;
if (subtitle = $('.boardSubtitle')) {
$.rm(subtitle);
}
return $('.boardTitle').innerHTML = d.title = "/" + board.board + "/ - " + board.title;
return $('.boardTitle').textContent = d.title = "/" + board + "/ - " + title;
},
refresh: function(context) {
var boardID, feature, name, threadID, view, _i, _len, _ref, _ref1;

View File

@ -109,7 +109,10 @@ Navigate =
Navigate.reconnect()
if view is 'index'
Navigate.updateBoard boardID unless boardID is g.BOARD.ID
if boardID is g.BOARD.ID
d.title = $('.boardTitle').textContent
else
Navigate.updateBoard boardID
Index.update()
# Moving from index to thread or thread to thread
@ -219,15 +222,15 @@ Navigate =
error: err
]
Header.setBoardList()
Header.setBoardList()
req = $.ajax '//a.4cdn.org/boards.json',
onabort: onload
onloadend: onload
updateTitle: (board) ->
updateTitle: ({board, title}) ->
$.rm subtitle if subtitle = $ '.boardSubtitle'
$('.boardTitle').innerHTML = d.title = "/#{board.board}/ - #{board.title}"
$('.boardTitle').textContent = d.title = "/#{board}/ - #{title}"
refresh: (context) ->
return