| 826 | | if(e.shiftKey && LilyUtils.controlOrCommand(e)) { |
|---|
| 827 | | //resize |
|---|
| 828 | | thisPtr.patchController.attachPatchObserver(thisPtr.obj.createElID("contentWrapper"),"mousedown",thisPtr.objResizeControl.mousedown,"select"); |
|---|
| 829 | | thisPtr.patchController.attachPatchObserver(thisPtr.obj.createElID("contentWrapper"),"mouseup",thisPtr.objResizeControl.mouseup,"select"); |
|---|
| 830 | | |
|---|
| 831 | | } else { |
|---|
| 832 | | //drag |
|---|
| 833 | | thisPtr.patchController.attachPatchObserver(thisPtr.id,"mousedown",thisPtr.objDrag.mousedown,"select"); |
|---|
| 834 | | thisPtr.patchController.attachPatchObserver(thisPtr.id,"mouseup",thisPtr.objDrag.mouseup,"select"); |
|---|
| 835 | | } |
|---|
| | 826 | //drag & resize |
|---|
| | 827 | thisPtr.patchController.attachPatchObserver(thisPtr.id,"mousedown",thisPtr.selectDelegate,"select"); |
|---|
| | 828 | thisPtr.patchController.attachPatchObserver(thisPtr.id,"mouseup",thisPtr.selectDelegate,"select"); |
|---|
| | 838 | } |
|---|
| | 839 | |
|---|
| | 840 | //funnel events to drag & resize |
|---|
| | 841 | this.selectDelegate=function(e) { |
|---|
| | 842 | if(e.shiftKey && LilyUtils.controlOrCommand(e)) { |
|---|
| | 843 | |
|---|
| | 844 | if(e.type=="mousedown") { |
|---|
| | 845 | thisPtr.objResizeControl.mousedown(e); |
|---|
| | 846 | } else if(e.type=="mouseup") { |
|---|
| | 847 | thisPtr.objResizeControl.mouseup(e); |
|---|
| | 848 | } |
|---|
| | 849 | |
|---|
| | 850 | } else { |
|---|
| | 851 | |
|---|
| | 852 | if(e.type=="mousedown") { |
|---|
| | 853 | thisPtr.objDrag.mousedown(e); |
|---|
| | 854 | } else if(e.type=="mouseup") { |
|---|
| | 855 | thisPtr.objDrag.mouseup(e); |
|---|
| | 856 | } |
|---|
| | 857 | } |
|---|
| 893 | | |
|---|
| 894 | | //drag |
|---|
| 895 | | thisPtr.patchController.removePatchObserver(thisPtr.id,"mousedown",thisPtr.objDrag.mousedown,"select"); |
|---|
| 896 | | thisPtr.patchController.removePatchObserver(thisPtr.id,"mouseup",thisPtr.objDrag.mouseup,"select"); |
|---|
| 897 | | |
|---|
| 898 | | //a little extra security |
|---|
| 899 | | if(0) thisPtr.patchController.removePatchObserver(thisPtr.id,"mousemove",thisPtr.objDrag.mousemove,"select"); |
|---|
| 900 | | |
|---|
| 901 | | //resize |
|---|
| 902 | | thisPtr.patchController.removePatchObserver(thisPtr.obj.createElID("contentWrapper"),"mousedown",thisPtr.objResizeControl.mousedown,"select"); |
|---|
| 903 | | thisPtr.patchController.removePatchObserver(thisPtr.obj.createElID("contentWrapper"),"mouseup",thisPtr.objResizeControl.mouseup,"select"); |
|---|
| | 906 | |
|---|
| | 907 | //drag & resize |
|---|
| | 908 | thisPtr.patchController.removePatchObserver(thisPtr.id,"mousedown",thisPtr.selectDelegate,"select"); |
|---|
| | 909 | thisPtr.patchController.removePatchObserver(thisPtr.id,"mouseup",thisPtr.selectDelegate,"select"); |
|---|