Disable opening new tab or pop-up when clicking block

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
cduijker
Posts: 15
Joined: Thursday 09 August 2018 15:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Disable opening new tab or pop-up when clicking block

Post by cduijker »

Goodmorning,

I would like to disable showing a new tab or popup when clicking on the news block.
Also disable opening a new tab when clicking on a frame block. (buienradar)

Is this possible?
Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Disable opening new tab or pop-up when clicking block

Post by Lokonli »

assume you've defined your block in CONFIG.js via:

Code: Select all

blocks['news'] = {
   ...
}
then you can disable handling of click events by adding the following to custom.css:

Code: Select all

[data-id="news"].dt_block {
    pointer-events: none
}
or,
add the addClass block parameter:

Code: Select all

blocks['news'] = {
   addClass: 'noclick',
   ....
}
and add the following to custom.css:

Code: Select all

.noclick {
  pointer-events: none
}
Both methods also work for frames.
cduijker
Posts: 15
Joined: Thursday 09 August 2018 15:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Disable opening new tab or pop-up when clicking block

Post by cduijker »

Thanks! that worked!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest