Reimplement QuoteThreading.disconnect cleanly
This commit is contained in:
parent
8bebd26989
commit
19bd52341d
@ -8392,6 +8392,20 @@
|
|||||||
parent: {},
|
parent: {},
|
||||||
children: {},
|
children: {},
|
||||||
inserted: {},
|
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() {
|
setThread: function() {
|
||||||
QuoteThreading.thread = this;
|
QuoteThreading.thread = this;
|
||||||
return $.asap((function() {
|
return $.asap((function() {
|
||||||
|
|||||||
@ -8437,6 +8437,20 @@
|
|||||||
parent: {},
|
parent: {},
|
||||||
children: {},
|
children: {},
|
||||||
inserted: {},
|
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() {
|
setThread: function() {
|
||||||
QuoteThreading.thread = this;
|
QuoteThreading.thread = this;
|
||||||
return $.asap((function() {
|
return $.asap((function() {
|
||||||
|
|||||||
@ -27,6 +27,7 @@ QuoteThreading =
|
|||||||
Thread.callbacks.push
|
Thread.callbacks.push
|
||||||
name: 'Quote Threading'
|
name: 'Quote Threading'
|
||||||
cb: @setThread
|
cb: @setThread
|
||||||
|
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
name: 'Quote Threading'
|
name: 'Quote Threading'
|
||||||
cb: @node
|
cb: @node
|
||||||
@ -35,6 +36,22 @@ QuoteThreading =
|
|||||||
children: {}
|
children: {}
|
||||||
inserted: {}
|
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: ->
|
setThread: ->
|
||||||
QuoteThreading.thread = @
|
QuoteThreading.thread = @
|
||||||
$.asap (-> !Conf['Thread Updater'] or $ '.navLinksBot > .updatelink'), ->
|
$.asap (-> !Conf['Thread Updater'] or $ '.navLinksBot > .updatelink'), ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user