Skip to content

Commit b5335d6

Browse files
committed
remove obsolete destroy logic
1 parent ceb9546 commit b5335d6

File tree

4 files changed

+4
-34
lines changed

4 files changed

+4
-34
lines changed

src/motion.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ export class Motion extends Events {
1111
}
1212

1313
reset_state() {
14-
$(this._down_scope).off('mousedown', this._down_handle);
15-
$(this._move_scope).off('mousemove', this._move_handle);
16-
$(document).off('mouseup', this._up_handle);
1714
this._move_handle = null;
1815
this._up_handle = null;
1916
this._prev_pos = null;

src/ssr/destroy.js

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,12 @@ export class AjaxDestroy extends Parser {
2222
node._ajax_attached = null; // remove class instances from memory
2323
}
2424

25-
let attrs = this.node_attrs(node);
26-
if (attrs['ajax:bind']) { // unbind events bound from AjaxDispatcher
27-
let evts = attrs['ajax:bind'];
28-
$(node).off(evts);
29-
}
30-
3125
// Run all registered callbacks
3226
for (let cb of destroy_handles) {
3327
cb(node);
3428
}
35-
36-
$(node).empty(); // remove retained comments
37-
$(node).off(); // remove event listeners
38-
$(node).removeData(); // remove cached data
39-
$.cleanData([node]); // explicitly remove from jQuery cache
40-
41-
node = null;
42-
instances = null;
43-
attrs = null;
29+
// remove retained comments, event listeners and cached data
30+
$(node).empty().off().removeData();
4431
}
4532
}
4633

treibstoff/bundle/treibstoff.bundle.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -568,21 +568,10 @@ var ts = (function (exports, $) {
568568
}
569569
node._ajax_attached = null;
570570
}
571-
let attrs = this.node_attrs(node);
572-
if (attrs['ajax:bind']) {
573-
let evts = attrs['ajax:bind'];
574-
$(node).off(evts);
575-
}
576571
for (let cb of destroy_handles) {
577572
cb(node);
578573
}
579-
$(node).empty();
580-
$(node).off();
581-
$(node).removeData();
582-
$.cleanData([node]);
583-
node = null;
584-
instances = null;
585-
attrs = null;
574+
$(node).empty().off().removeData();
586575
}
587576
}
588577
function ajax_destroy(elem) {
@@ -1620,9 +1609,6 @@ var ts = (function (exports, $) {
16201609
this._move_scope = null;
16211610
}
16221611
reset_state() {
1623-
$(this._down_scope).off('mousedown', this._down_handle);
1624-
$(this._move_scope).off('mousemove', this._move_handle);
1625-
$(document).off('mouseup', this._up_handle);
16261612
this._move_handle = null;
16271613
this._up_handle = null;
16281614
this._prev_pos = null;

treibstoff/bundle/treibstoff.bundle.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)