diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 02423ad40..7d2c4fea7 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -8392,6 +8392,20 @@ parent: {}, children: {}, inserted: {}, + disconnect: function() { + if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) { + return; + } + Header.menu.rmEntry(this.entry); + delete this.enabled; + delete this.controls; + delete this.entry; + this.parent = {}; + this.children = {}; + this.inserted = {}; + Thread.callbacks.disconnect('Quote Threading'); + return Post.callbacks.disconnect('Quote Threading'); + }, setThread: function() { QuoteThreading.thread = this; return $.asap((function() { diff --git a/builds/crx/script.js b/builds/crx/script.js index bccef7c1e..3fcfcbc94 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -8437,6 +8437,20 @@ parent: {}, children: {}, inserted: {}, + disconnect: function() { + if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) { + return; + } + Header.menu.rmEntry(this.entry); + delete this.enabled; + delete this.controls; + delete this.entry; + this.parent = {}; + this.children = {}; + this.inserted = {}; + Thread.callbacks.disconnect('Quote Threading'); + return Post.callbacks.disconnect('Quote Threading'); + }, setThread: function() { QuoteThreading.thread = this; return $.asap((function() { diff --git a/src/Quotelinks/QuoteThreading.coffee b/src/Quotelinks/QuoteThreading.coffee index b26fdc6af..df190c6c4 100755 --- a/src/Quotelinks/QuoteThreading.coffee +++ b/src/Quotelinks/QuoteThreading.coffee @@ -27,6 +27,7 @@ QuoteThreading = Thread.callbacks.push name: 'Quote Threading' cb: @setThread + Post.callbacks.push name: 'Quote Threading' cb: @node @@ -35,6 +36,22 @@ QuoteThreading = children: {} inserted: {} + disconnect: -> + return unless Conf['Quote Threading'] and g.VIEW is 'thread' + + Header.menu.rmEntry @entry + + delete @enabled + delete @controls + delete @entry + + @parent = {} + @children = {} + @inserted = {} + + Thread.callbacks.disconnect 'Quote Threading' + Post.callbacks.disconnect 'Quote Threading' + setThread: -> QuoteThreading.thread = @ $.asap (-> !Conf['Thread Updater'] or $ '.navLinksBot > .updatelink'), ->