Avoid conflicting thread/post IDs between different boards in g.threads/posts.

This commit is contained in:
Nicolas Stepien 2012-08-27 04:31:14 +02:00
parent e4eb6b2d7c
commit 4a3da8bafb
2 changed files with 5 additions and 5 deletions

View File

@ -621,7 +621,7 @@
this.ID = +root.id.slice(1);
this.hr = root.nextElementSibling;
this.posts = {};
g.threads[this.ID] = board.threads[this.ID] = this;
g.threads["" + board.ID + "." + this.ID] = board.threads[this.ID] = this;
}
return Thread;
@ -636,7 +636,7 @@
this.board = board;
this.ID = +root.id.slice(2);
this.el = $('.post', root);
g.posts[this.ID] = thread.posts[this.ID] = board.posts[this.ID] = this;
g.posts["" + board.ID + "." + this.ID] = thread.posts[this.ID] = board.posts[this.ID] = this;
}
return Post;

View File

@ -485,14 +485,14 @@ class Thread
@hr = root.nextElementSibling
@posts = {}
g.threads[@ID] = board.threads[@ID] = @
g.threads["#{board.ID}.#{@ID}"] = board.threads[@ID] = @
class Post
constructor: (@root, @thread, @board) ->
@ID = +root.id[2..]
@el = $ '.post', root
g.posts[@ID] = thread.posts[@ID] = board.posts[@ID] = @
g.posts["#{board.ID}.#{@ID}"] = thread.posts[@ID] = board.posts[@ID] = @
Main =
init: ->
@ -528,13 +528,13 @@ Main =
if $.hasClass child, 'postContainer'
new Post child, thread, g.BOARD
$.log g
addStyle: ->
$.off d, 'DOMNodeInserted', Main.addStyle
if d.head
$.addStyle Main.css
else
$.on d, 'DOMNodeInserted', Main.addStyle
css: '
.move {
cursor: move;