Reimplement QuoteThreading.disconnect cleanly
This commit is contained in:
parent
8bebd26989
commit
19bd52341d
@ -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() {
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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'), ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user