diff --git a/4chan_x.user.js b/4chan_x.user.js index c848e8ed0..c722267ae 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -669,6 +669,7 @@ if (g.REPLY = pathname[2] === 'res') { g.THREAD = +pathname[3]; } + Main.addStyle(); return $.ready(Main.ready); }, ready: function() { @@ -689,7 +690,23 @@ } } return $.log(g); - } + }, + addStyle: function() { + $.off(d, 'DOMNodeInserted', Main.addStyle); + if (d.head) { + return $.addStyle(Main.css); + } else { + return $.on(d, 'DOMNodeInserted', Main.addStyle); + } + }, + css: '\ +.move {\ + cursor: move;\ +}\ +label {\ + cursor: pointer;\ +}\ +' }; Main.init(); diff --git a/script.coffee b/script.coffee index 871f7246f..94aa92cd8 100644 --- a/script.coffee +++ b/script.coffee @@ -516,6 +516,8 @@ Main = if g.REPLY = pathname[2] is 'res' g.THREAD = +pathname[3] + Main.addStyle() + $.ready Main.ready ready: -> board = $ '.board' @@ -526,5 +528,20 @@ 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; +} +label { + cursor: pointer; +} +' Main.init()