调整blockly滚动条

This commit is contained in:
YouWei Zhao 2018-03-17 01:24:06 +08:00
parent 6a5906b0da
commit 12a7d213f2

View File

@ -230,13 +230,14 @@ window.addEventListener('resize', onresize, false);
onresize();
Blockly.svgResize(workspace);
//Blockly.bindEventWithChecks_(editor_blockly.workspace.svgGroup_,"wheel",editor_blockly.workspace,function(e){});
//Blockly.bindEventWithChecks_(workspace.svgGroup_,"wheel",workspace,function(e){});
document.getElementById('blocklyDiv').onmousewheel = function(e){
//console.log(e);
e.preventDefault();
var hvScroll = e.shiftKey?'hScroll':'vScroll';
editor_blockly.workspace.scrollbar[hvScroll].handlePosition_+=( ((e.deltaY||0)+(e.detail||0)) >0?20:-20);
editor_blockly.workspace.scrollbar[hvScroll].onScroll_();
workspace.scrollbar[hvScroll].handlePosition_+=( ((e.deltaY||0)+(e.detail||0)) <0?20:-20);
workspace.scrollbar[hvScroll].onScroll_();
workspace.setScale(workspace.scale);
}
var doubleClickCheck=[[0,'abc']];