How to disable back to back touches for ccui.button

I’m using ccui.button in my cocos2djs game, I actually do not want to press my button back to back. A small time gap between the touched would be nice. Is there any easy way of doing so?. Now what happens is, I could press the button back to back resulting in a crash. Any suggestions…

Not sure if I understand fully, but you can disable the button upon the first action, and then re-enable it based on your needs.

What does the crash say?

spin_btn = new ccui.Button('spinbtn-show-01.png', '', '', ccui
 .Widget.PLIST_TEXTURE);
spin_btn.setPosition(200, 300);
spin_btn.setZoomScale(-0.05);
spin_btn.addTouchEventListener(this.onClick);
this.addChild(spin_btn);

//This handles click

onClick: function (sender, type) {
'use strict';

//I tried this 
sender.setTouchEnabled(false); 

 if (type === ccui.Widget.TOUCH_ENDED ||
  type === ccui.Widget.TOUCH_CANCELED) {
  this.stopAllActions();
  this.runAction(cc.sequence(cc.scaleTo(0.05, 1),
  cc.callFunc(this.cb || function () {}, this, sender)));
 } else if (type === ccui.Widget.TOUCH_BEGAN) {
   this.stopAllActions();
   this.runAction(cc.scaleTo(0.05, 0.9));
  }
 sender.setTouchEnabled(true) // <-- this doesnot work
 },

Is this there right way? Or have any other way

Check this is link, may be it will help.