MCPcopy
hub / github.com/kekingcn/kkFileView / leftButtonDown

Function leftButtonDown

server/src/main/resources/static/js/codemirror.js:1566–1571  ·  view source on GitHub ↗
(cm,pos,repeat,event)

Source from the content-addressed store, hash-verified

1564if(value.moveOnDrag==null){value.moveOnDrag=!(mac?event.altKey:event.ctrlKey);}
1565return value}
1566function leftButtonDown(cm,pos,repeat,event){if(ie){setTimeout(bind(ensureFocus,cm),0);}
1567else{cm.curOp.focus=activeElt(root(cm));}
1568var behavior=configureMouse(cm,repeat,event);var sel=cm.doc.sel,contained;if(cm.options.dragDrop&&dragAndDrop&&!cm.isReadOnly()&&repeat=="single"&&(contained=sel.contains(pos))>-1&&(cmp((contained=sel.ranges[contained]).from(),pos)<0||pos.xRel>0)&&(cmp(contained.to(),pos)>0||pos.xRel<0))
1569{leftButtonStartDrag(cm,event,pos,behavior);}
1570else
1571{leftButtonSelect(cm,event,pos,behavior);}}
1572function leftButtonStartDrag(cm,event,pos,behavior){var display=cm.display,moved=false;var dragEnd=operation(cm,function(e){if(webkit){display.scroller.draggable=false;}
1573cm.state.draggingText=false;if(cm.state.delayingBlurEvent){if(cm.hasFocus()){cm.state.delayingBlurEvent=false;}
1574else{delayBlurEvent(cm);}}

Callers 1

onMouseDownFunction · 0.85

Calls 10

activeEltFunction · 0.85
rootFunction · 0.85
configureMouseFunction · 0.85
leftButtonStartDragFunction · 0.85
leftButtonSelectFunction · 0.85
fromMethod · 0.80
toMethod · 0.80
bindFunction · 0.70
cmpFunction · 0.70
containsMethod · 0.45

Tested by

no test coverage detected