fix tournament JS memory leak by destroying powertips on unload
This commit is contained in:
parent
88b30af146
commit
1ba4aa2201
|
@ -23,7 +23,12 @@ module.exports = function(ctrl) {
|
|||
attrs: {
|
||||
key: p.id,
|
||||
href: '/' + p.id,
|
||||
class: 'glpt'
|
||||
class: 'glpt',
|
||||
config: function(el, isUpdate, ctx) {
|
||||
if (!isUpdate) ctx.onunload = function() {
|
||||
$.powerTip.destroy(el);
|
||||
};
|
||||
}
|
||||
},
|
||||
children: [
|
||||
user(p, 0),
|
||||
|
|
|
@ -60,7 +60,12 @@ module.exports = function(ctrl) {
|
|||
return m('tr', {
|
||||
key: p.id,
|
||||
'data-href': '/' + p.id + '/' + p.color,
|
||||
class: 'glpt' + (res === '1' ? ' win' : (res === '0' ? ' loss' : ''))
|
||||
class: 'glpt' + (res === '1' ? ' win' : (res === '0' ? ' loss' : '')),
|
||||
config: function(el, isUpdate, ctx) {
|
||||
if (!isUpdate) ctx.onunload = function() {
|
||||
$.powerTip.destroy(el);
|
||||
};
|
||||
}
|
||||
}, [
|
||||
m('th', Math.max(nb.game, pairingsLen) - i),
|
||||
m('td', (p.op.title ? p.op.title + ' ' : '') + p.op.name),
|
||||
|
|
|
@ -71,6 +71,11 @@ module.exports = {
|
|||
var fullName = (p.title ? p.title + ' ' : '') + p.name;
|
||||
var attrs = {
|
||||
class: 'ulpt user_link' + (fullName.length > 15 ? ' long' : ''),
|
||||
config: function(el, isUpdate, ctx) {
|
||||
if (!isUpdate) ctx.onunload = function() {
|
||||
$.powerTip.destroy(el);
|
||||
};
|
||||
}
|
||||
};
|
||||
attrs[tag === 'a' ? 'href' : 'data-href'] = '/@/' + p.name;
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue