Home › Forums › Calendar Products › Events Calendar PRO › Disable event clicks in week view
- This topic has 9 replies, 2 voices, and was last updated 7 years, 11 months ago by
Andrew Bruske.
-
AuthorPosts
-
April 16, 2018 at 2:57 am #1507923
Andrew Bruske
ParticipantHi
I am looking to have just a calendar showing in week view and would like to disable the ability to click on events which takes them away from the week view page. Is it possible to disable the ability for a user to click on an event and basically just allow them to view the calendar in week mode?
Regards
AndrewApril 17, 2018 at 7:42 am #1509176Jeremy
KeymasterHi Andrew,
Thanks for reaching out to us!
In order to disable the ability for a user to click on an event in the Week view of your calendar, you can use some CSS.
First, head over to Appearance > Customize > Additional CSS.
Then, you can add the following snippet:
.tribe-events-week-grid .type-tribe_events a { pointer-events: none; }Please let me know if that solves your problem.
Cheers,
JeremyMay 1, 2018 at 3:47 am #1519923Andrew Bruske
ParticipantHi Jeremy
This is working fine in week view. Is it possible to also do this in list view? When the calendar is viewed in mobile list view I can still click on the event title.
Regards
AndrewMay 1, 2018 at 6:20 am #1520028Jeremy
KeymasterHi Andrew,
Yes, you could disable the click for the list view as well. In order to do so, you could add, in Additional CSS, below the previous snippet:
.tribe-events-list .tribe-events-list-event-title a { pointer-events: none; }In case you want to get rid of the “Find out more” button, you could add the following code:
.tribe-events-list .tribe-events-read-more { pointer-events: none; }I hope this helps,
Cheers,
JeremyMay 6, 2018 at 5:32 am #1523795Andrew Bruske
ParticipantHi Jeremy
I think I got a little confused. I don’t think its list view that I’m trying to modify its the “mobile friendly” view of week view. I’m not quite sure if thats the list view or not? its when the calendar is showing in week view, if that same calendar is viewed on a mobile device the calendar shows in a list format.
What I’m trying to do is disable the ability for the use to click on any part of the event in either full week view on a normal screen as well as when the calendar changes to mobile view when viewing on a mobile device. At the moment the code below seems to only disable the ability to click an event in the normal week view, not the mobile friendly view.
.tribe-events-week-grid .type-tribe_events a {
pointer-events: none;
}Does that make sense?
May 7, 2018 at 5:29 am #1524167Jeremy
KeymasterHi Andrew,
Thanks for your clarification, I understand better now.
I visited your website on a mobile device (this page to be more accurate: http://www.xtremeice.com.au/events/) and the click was properly disabled. If the click works on your side, it might be a cache problem (you may clear your browser cache).
If your issue happens on a specific page and not the one I mentioned, please share the URL so I could have a look at it. Thanks in advance 🙂
Cheers,
JeremyMay 7, 2018 at 6:49 am #1524238Andrew Bruske
ParticipantThanks Jeremy
I think the issue might actually be internet explorer. When I view this on internet explorer and change the browser to a mobile size the links are clickable still. If I do the same thing on the same computer in Chrome it doesn’t allow clicks and this was done on a completely separate computer to the one I was working on initially
May 8, 2018 at 1:00 am #1524967Jeremy
KeymasterHi Andrew,
Indeed, the pointer-events property is not supported by IE, I forgot about that.
A workaround here would be to add a polyfill in your theme.
Could you download the JS file in this page and add it to your theme (in a JS folder)?
To call this file from your theme, you can add this in the head tag:
<script src="<?php echo get_template_directory_uri(); ?>/JS/pointer_events_polyfill.js></script>Finally, in your main.js file, you can add the jQuery script:
$(document).ready(function(){ PointerEventsPolyfill.initialize({}); });I hope this will work.
Cheers,
JeremyMay 9, 2018 at 7:25 am #1526140Andrew Bruske
ParticipantThanks Jeremy
I have added that file under the JS folder but I’m not quite sure what you mean by:
“To call this file from your theme, you can add this in the head tag”?
I also cannot locate a “main.js” file?
May 10, 2018 at 12:55 am #1526954Jeremy
KeymasterHi Andrew,
Well, if you don’t have a main.js file, you can create one, that you will save under your-theme/JS. In that file, you can just add that script:
$(document).ready(function(){ PointerEventsPolyfill.initialize({}); });Actually it would be a better practice to enqueue the scripts from your functions.php file, so no need to add the link to pointer_events_polyfill.js directly in the head tag.
Instead, open your functions.php file and add the following code:
function tec_extremeice_enqueue_scripts() { wp_enqueue_script( 'mainjs', get_stylesheet_directory_uri() . '/JS/main.js' ); wp_enqueue_script( 'pointer_events_polyfill', get_template_directory_uri() . '/JS/pointer_events_polyfill.js' ); } add_action('wp_enqueue_scripts', 'tec_extremeice_enqueue_scripts');Please do let me know if that works, of if you need more help on this.
Cheers,
JeremyJune 1, 2018 at 9:35 am #1543935Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Disable event clicks in week view’ is closed to new replies.
