Page 1 of 2

How to 'unclick' a button

Posted: Tue May 13, 2014 8:51 pm
by pboloz

When I click this 'refresh map' button it changes colour to blue and stays like that until I go to other screen. How can I change the settings so that this button changes colour only when clicked and then automatically goes back to it's normal colour?

Image


How to 'unclick' a button

Posted: Wed May 14, 2014 12:46 am
by Yurii Orishchuk

Hi Pbolos.

Please use this code:

pre
code

//Where "yourButtonName" is - "Refresh Map" button name.
Apperyio("yourButtonName").removeClass("ui-btn-active");

/code
/pre

Note to find "Refresh Map" button name please:

1 Activate this button in the page design mode by clicking on.

2 Copy it in "name" attribute in button properties.

See details: http://prntscr.com/3j0hw9/direct

Regards.


How to 'unclick' a button

Posted: Wed May 14, 2014 1:03 am
by pboloz

I am not sure where do I copy the code you gave me?


How to 'unclick' a button

Posted: Wed May 14, 2014 1:12 am
by pboloz

Do I need to create new JS and copy it there?


How to 'unclick' a button

Posted: Wed May 14, 2014 4:02 am
by Yurii Orishchuk

Pbolos,

You should use this code in the JS event handler on event you need.

For example if need to delete selection on any footer button click you should to do:

1 Activate your mobileFooter. http://prntscr.com/3j1ppx/direct

2 Open Events bottom panel and set JS event handler for "click" event. http://prntscr.com/3j1q7s/direct

3 Populate it with following code:

precode

var navBar = this;

var onDelay = function(){
jQuery(navBar).find(".ui-btn-active").removeClass("ui-btn-active");
};
window.setTimeout(onDelay, 500);

/code/pre

This will delete selection after 0.5sec after clicked on.

Regards.


How to 'unclick' a button

Posted: Wed May 14, 2014 4:30 am
by pboloz

I have done as you said Yurii, but it did not work.

Image


How to 'unclick' a button

Posted: Wed May 14, 2014 4:31 am
by pboloz

Can you spot what am I doing wrong Yurii?


How to 'unclick' a button

Posted: Wed May 14, 2014 4:45 am
by Yurii Orishchuk

Pbolos,

Perhaps you've selected as component name "button" ? You should to select all footer.

http://prntscr.com/3j1x2g/direct

See again second step:

precode

2 Open Events bottom panel and set JS event handler for "click" event. http://prntscr.com/3j1q7s/direct

/code/pre

Regards.


How to 'unclick' a button

Posted: Wed May 14, 2014 4:57 am
by pboloz

Yes. I have selected a button instead of a navbar. It works now. Thank you.


How to 'unclick' a button

Posted: Wed May 14, 2014 5:07 am
by Yurii Orishchuk

Pboloz,

Thanks for update.

Regards.