Remove prototype pollution, call on ready
This commit is contained in:
parent
cbe12019c4
commit
c3ba4cc7ef
@ -1,4 +1,6 @@
|
|||||||
Array.prototype.remove = function(v) { this.splice(this.indexOf(v) == -1 ? this.length : this.indexOf(v), 1); }
|
if (active_page == 'thread' || active_page == 'index') {
|
||||||
|
$(document).ready(function(){
|
||||||
|
function arrayRemove(a, v) { a.splice(a.indexOf(v) == -1 ? a.length : a.indexOf(v), 1); }
|
||||||
|
|
||||||
var idshighlighted = [];
|
var idshighlighted = [];
|
||||||
|
|
||||||
@ -25,7 +27,7 @@ $(".poster_id").click(function(){
|
|||||||
var id = $(this).text();
|
var id = $(this).text();
|
||||||
|
|
||||||
if($.inArray(id, idshighlighted) !== -1){
|
if($.inArray(id, idshighlighted) !== -1){
|
||||||
idshighlighted.remove(id);
|
arrayRemove(idshighlighted, id);
|
||||||
|
|
||||||
$(getMasterPosts(getPostsById(id).parents())).each(function(i){
|
$(getMasterPosts(getPostsById(id).parents())).each(function(i){
|
||||||
$(this).removeClass("highlighted");
|
$(this).removeClass("highlighted");
|
||||||
@ -38,3 +40,5 @@ $(".poster_id").click(function(){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user