55 行
2.6 KiB
HTML
可执行文件
55 行
2.6 KiB
HTML
可执行文件
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>零售diy</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
|
||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/Public/DIY/iframe/static/index.2da1efab.css><style>
|
||
/* 防抖动CSS:防止re-render期间滚动条闪烁和布局抖动 */
|
||
body{overflow-y:scroll!important;overflow-anchor:auto}
|
||
.draggable-box{will-change:contents;contain:layout style}
|
||
.draggable-box>.component{will-change:auto}
|
||
</style></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script>/* DIY编辑器-防抖动补丁 v2.0 */
|
||
(function(){
|
||
'use strict';
|
||
var _origAdd=window.addEventListener.bind(window);
|
||
var _extenders=[];
|
||
var DEBOUNCE_MS=200;
|
||
var DEBOUNCE_CLICK_MS=300;
|
||
|
||
// 执行dataUpdate时保持布局稳定
|
||
function stableExec(listener,evt){
|
||
var scrollEl=document.scrollingElement||document.documentElement;
|
||
var scrollTop=scrollEl.scrollTop;
|
||
var box=document.getElementsByClassName('draggable-box')[0];
|
||
var boxH=box?box.offsetHeight:0;
|
||
if(box&&boxH>0) box.style.minHeight=boxH+'px';
|
||
listener(evt);
|
||
requestAnimationFrame(function(){
|
||
scrollEl.scrollTop=scrollTop;
|
||
if(box) setTimeout(function(){box.style.minHeight='';},150);
|
||
});
|
||
}
|
||
|
||
window.addEventListener=function(type,listener,options){
|
||
if(type==='message'){
|
||
var _timer=null,_pending=null;
|
||
_extenders.push(function(){
|
||
if(_pending){
|
||
clearTimeout(_timer);
|
||
_timer=setTimeout(function(){if(_pending){var e=_pending;_pending=null;stableExec(listener,e);}},DEBOUNCE_CLICK_MS);
|
||
}
|
||
});
|
||
var wrapped=function(evt){
|
||
if(evt&&evt.data&&evt.data.type==='dataUpdate'){
|
||
_pending=evt;
|
||
clearTimeout(_timer);
|
||
_timer=setTimeout(function(){if(_pending){var e=_pending;_pending=null;stableExec(listener,e);}},DEBOUNCE_MS);
|
||
} else {
|
||
listener(evt);
|
||
}
|
||
};
|
||
return _origAdd(type,wrapped,options);
|
||
}
|
||
return _origAdd(type,listener,options);
|
||
};
|
||
_origAdd('click',function(){
|
||
_extenders.forEach(function(fn){fn();});
|
||
},true);
|
||
})();
|
||
</script><script src=/Public/DIY/iframe/static/js/chunk-vendors.5d4f24c0.js></script><script src=/Public/DIY/iframe/static/js/index.42d68f79.js></script></body></html> |