Avoid conflicting thread/post IDs between different boards in g.threads/posts.
This commit is contained in:
parent
e4eb6b2d7c
commit
4a3da8bafb
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user