Fix laggy and blinking tooltips

pull/1/head
yflory 7 years ago
parent 1f53304ad3
commit 630ac45948

@ -515,7 +515,8 @@ define([
distance: 0, distance: 0,
performance: true, performance: true,
dynamicTitle: true, dynamicTitle: true,
delay: [delay, 0] delay: [delay, 0],
sticky: true
}); });
}; };
// This is the robust solution to remove dangling tooltips // This is the robust solution to remove dangling tooltips
@ -534,17 +535,22 @@ define([
var observer = new MutationObserver(function(mutations) { var observer = new MutationObserver(function(mutations) {
var removed = false; var removed = false;
mutations.forEach(function(mutation) { mutations.forEach(function(mutation) {
for (var i = 0; i < mutation.addedNodes.length; i++) { if (mutation.type === "childList") {
$(mutation.addedNodes[i]).find('[title]').each(addTippy); for (var i = 0; i < mutation.addedNodes.length; i++) {
$(mutation.addedNodes[i]).find('[title]').each(addTippy);
}
for (var j = 0; j < mutation.removedNodes.length; j++) {
removed |= checkRemoved(mutation.removedNodes[j]);
}
} }
for (var j = 0; j < mutation.removedNodes.length; j++) { if (mutation.type === "attributes" && mutation.attributeName === "title") {
removed |= checkRemoved(mutation.removedNodes[j]); addTippy(0, mutation.target);
} }
}); });
if (removed) { UI.clearTooltips(); } if (removed) { UI.clearTooltips(); }
}); });
observer.observe($('body')[0], { observer.observe($('body')[0], {
attributes: false, attributes: true,
childList: true, childList: true,
characterData: false, characterData: false,
subtree: true subtree: true

@ -425,6 +425,10 @@ var Renderer = function (APP) {
var diffOptions = { var diffOptions = {
preDiffApply: function (info) { preDiffApply: function (info) {
if (!diffIsInput(info)) { return; } if (!diffIsInput(info)) { return; }
if (info.diff.action === "removeAttribute" &&
(info.diff.name === "aria-describedby" || info.diff.name === "data-original-title")) {
return;
}
switch (getInputType(info)) { switch (getInputType(info)) {
case 'number': case 'number':
//console.log('checkbox'); //console.log('checkbox');

Loading…
Cancel
Save