pboloz
Posts: 0
Joined: Wed Apr 02, 2014 11:38 pm

How to 'unclick' a button

I actually need to do the same with a button now. What would I have to change in this code then? I guess I have to change navBar to something else, but what?

var navBar = this;

var onDelay = function(){

jQuery(navBar).find(".ui-btn-active").removeClass("ui-btn-active");

};

window.setTimeout(onDelay, 500);

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to 'unclick' a button

Hi Pbolos.

If you with to add this behavior to all button components in your app please follow this solution:

1 Add new JS asset.

2 Populate it with code below: http://prntscr.com/3jboam/direct

precode

var onButtonClick = function(){

Code: Select all

 var button = jQuery(this); 

 var onDelay = function(){ 

     console.log("Blur clicked button after delay"); 
     button.blur(); 

 }; 
 window.setTimeout(onDelay, 500); 

};
jQuery(".ui-btn").on("click", onButtonClick);

/code/pre

That's all.

Regards.

Return to “Issues”