This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Botton to close a widjet
#1
Hi, I would like to close a widget not only clicking outside it, but also clicking on an icon object (i.e. X) like in the picture. How I can do?

Thanks 

Peppe

Attached Files Thumbnail(s)
   
Reply
#2
Use hide-widget class, add to custom JS:
Code:
$(function() {
  $('.hide-widget').off('vclick').on('vclick', hideWidgets);
});
No need to duplicate this code for multiple widgets, use the same class and it will work correctly.
Reply
#3
(12.01.2021, 12:45)admin Wrote: Use hide-widget class, add to custom JS:
Code:
$(function() {
  $('.hide-widget').off('vclick').on('vclick', hideWidgets);
});
No need to duplicate this code for multiple widgets, use the same class and it will work correctly.

Great! Thank you so much.

Peppe
Reply
#4
Hi,

In my case I have a widget to control the heating mode => it pops up 4 additional buttons to select the appropriate mode.
Now I have to the select the mode and then push next to the widget to close it.
I would like to auto-close the widget as soon as one of those 4 buttons have been pushed, and thus a heating mode has been selected.

What would be the custom css in this case?

Thank you!

Thijs
Reply
#5
Add hide-widget class to all buttons, add to custom JS:
Code:
$(function() {
  $('.hide-widget').on('vclick', hideWidgets);
});
This will keep the original event that sends an object value and will close the widget when clicked.
Reply
#6
(03.03.2021, 14:02)admin Wrote: Add hide-widget class to all buttons, add to custom JS:
Code:
$(function() {
  $('.hide-widget').on('vclick', hideWidgets);
});
This will keep the original event that sends an object value and will close the widget when clicked.

Awesome admin!
Reply
#7
(12.01.2021, 12:45)admin Wrote: Use hide-widget class, add to custom JS:
Code:
$(function() {
  $('.hide-widget').off('vclick').on('vclick', hideWidgets);
});
No need to duplicate this code for multiple widgets, use the same class and it will work correctly.

I have tried this solution. Now the widget close when i push the button but it didn't send any value to the direction group....what i am missing?

Attached Files Thumbnail(s)
       
Reply
#8
Works for me - object value is sent and widget is closed. Which browser are you using?
Reply
#9
(09.06.2023, 11:53)admin Wrote: Works for me - object value is sent and widget is closed. Which browser are you using?

CHROME  Version 114.0.5735.110 (Build oficial) (64 bits)
Reply
#10
I tried it too on SL and it works for me. Which firmware do you use?
------------------------------
Ctrl+F5
Reply
#11
(13.06.2023, 13:53)Daniel Wrote: I tried it too on SL and it works for me. Which firmware do you use?

Hello Daniel, we have 2.7.0 on the LM now
Reply
#12
There is no such thing like 2.7.0 for LM Smile I tried it on 2.8.0 on SL
------------------------------
Ctrl+F5
Reply
#13
(13.06.2023, 14:07)Daniel Wrote: There is no such thing like 2.7.0 for LM Smile I tried it on 2.8.0 on SL

Sorry the confusion! 2.7.0 SL no LM..... I will update to 2.8.0 thankyou
Reply
#14
(13.06.2023, 14:39)j.martinez@t-ingeniamos.com Wrote:
(13.06.2023, 14:07)Daniel Wrote: There is no such thing like 2.7.0 for LM Smile I tried it on 2.8.0 on SL

Sorry the confusion! 2.7.0 SL no LM..... I will update to 2.8.0 thankyou

Updated and now working fine!!

Thank you everyone!!!
Reply


Forum Jump: