mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-16 23:42:39 +01:00
Safari: smoother popup pane toggling; cleanup popup js
This commit is contained in:
parent
68739e3df3
commit
e7165c9ff7
@ -27,13 +27,23 @@ if(typeof safari.self === "undefined" || window.top !== window) {
|
|||||||
|
|
||||||
var onLoaded = function() {
|
var onLoaded = function() {
|
||||||
var _toggle = DOMTokenList.prototype.toggle;
|
var _toggle = DOMTokenList.prototype.toggle;
|
||||||
|
var unchainPane2Timeout = false;
|
||||||
|
var unchainPane2 = function() {
|
||||||
|
pane2.style.removeProperty("display");
|
||||||
|
};
|
||||||
DOMTokenList.prototype.toggle = function(className, enabled) {
|
DOMTokenList.prototype.toggle = function(className, enabled) {
|
||||||
if(className === "dfEnabled") {
|
if(className === "dfEnabled") {
|
||||||
|
if(unchainPane2Timeout !== false) {
|
||||||
|
clearTimeout(unchainPane2Timeout);
|
||||||
|
unchainPane2Timeout = false;
|
||||||
|
}
|
||||||
|
_toggle.apply(this, arguments);
|
||||||
|
pane2.style.setProperty("display", "inline-block", "important");
|
||||||
|
unchainPane2Timeout = setTimeout(unchainPane2, 700);
|
||||||
updateSize(enabled);
|
updateSize(enabled);
|
||||||
}
|
}
|
||||||
_toggle.apply(this, arguments);
|
else {
|
||||||
if(className === "dfEnabled") {
|
_toggle.apply(this, arguments);
|
||||||
setTimeout(updateSize, 0);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var body = document.body,
|
var body = document.body,
|
||||||
|
Loading…
Reference in New Issue
Block a user