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

View File

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

View File

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