javascript - How to prevent activated mousedown event by function? -
function itext(){ function addtext() { canvas.on('mouse:up', function(options) { var left1=math.round(options.e.clientx)-139; var top1=math.round(options.e.clienty)-250; var newtext = new fabric.itext("",{ left:left1, top:top1 }); canvas.add(newtext); canvas.setactiveobject(newtext); newtext.enterediting(); newtext.selectall(); }); } canvas.on('mouse:down', addtext); }
i want add itext canvas when click on canvas.i using function.after execute function mouseevent should disabled.but have no idea how prevent activated mouseevent.any idea/example appreciated.thank you.
set boolean variable false before function executed. function checks see if true, if true nothing. if false, want , sets variable true. way executed once.
Comments
Post a Comment