Home › Forums › Calendar Products › Events Calendar PRO › Extending tribe-events-week.js?
- This topic has 5 replies, 2 voices, and was last updated 6 years, 7 months ago by Brian Walters.
-
AuthorPosts
-
September 11, 2017 at 2:32 pm #1347744Brian WaltersParticipant
I have events that start at :15 and :45 minutes of the hour. This isn’t a problem unless there is another event right after it.
With a 15 minute event, the space allocated to it should only be 15px (they are using 1px per minute in the code… Nice but that means a 15 minute event will get padded to a div element of 36px after it increases the title to 20px and adds the padding of 16px.
I’ve followed the Themer’s Guide down to the week/tooltip.php template. That’s when I determined the output of the file was then being processed by the javascript funtion tribe_display_week_view() in events-calendar-pro/src/resources/js/tribe-events-week.js
Is there a way to replace/extend that js function without completely overwriting the file. Essentially, I need to adjust it’s calculations from 1px per minute to 2px per hour so I can fit 15 minute events in correctly.
BTW: I’ve already figured out the CSS adjustments to the week view
// set 30 minute marks to 2px per minute .tribe-week-grid-block div{ height:60px; } // set 60 minute marks to 2px per minute .tribe-events-grid .column.first div, .tribe-week-grid-hours div, .tribe-week-grid-block { height:120px; }
Hopefully you can point me in some direction other than your list of custom developers.
- This topic was modified 6 years, 8 months ago by Brian Walters.
- This topic was modified 6 years, 8 months ago by Andras.
September 13, 2017 at 8:31 am #1348597AndrasKeymasterHi Brian,
Thanks for reaching out!
Currently the only way would be dequeuing that js file and replace it with an edited copy.
Though we are limited in doing customizations, I should be able to give you some guidance and pointers if needed. Let me know.
Cheers,
AndrasSeptember 13, 2017 at 9:24 am #1348639Brian WaltersParticipantThanks Andras. I thought that might be the only option. Could you suggest the best way to “dequeue” that JS file? Editing the JS file is the easier part, IMHO. 🙂
September 14, 2017 at 6:23 am #1349137AndrasKeymasterHey Brian,
This snippet should do that:
/**
* An example for how to dequeue a script
*
* Obtain the handle of your script by searching through the code, and then
* add a wp_deregister_script() function call for that handle.
*/
function tribe_dequeue_script_example() {
wp_deregister_script( 'tribe-events-jquery-resize' );
}
add_action( 'wp_enqueue_scripts', 'tribe_dequeue_script_example', PHP_INT_MAX );
add_action( 'admin_enqueue_scripts', 'tribe_dequeue_script_example', PHP_INT_MAX );Just change the function call.
Let me know if that helps.
Cheers,
AndrasOctober 6, 2017 at 9:35 am #1360388Support DroidKeymasterHey 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 ‘Extending tribe-events-week.js?’ is closed to new replies.