init commit
This commit is contained in:
38
assets/js/custom.js
Normal file
38
assets/js/custom.js
Normal file
@@ -0,0 +1,38 @@
|
||||
jQuery(function ($) {
|
||||
|
||||
// Getting links from a page and turning them into a scroll-spy bespoke menu
|
||||
|
||||
// FIXME when page loads with #... in url, the scroll spy gets messed up.
|
||||
|
||||
let links;
|
||||
|
||||
links = document.querySelectorAll("#one, #two, #three")
|
||||
|
||||
let url = window.location.href;
|
||||
|
||||
let innerContent = "";
|
||||
|
||||
links.forEach(link => {
|
||||
let fullUrl = url + "#" + link.id;
|
||||
innerContent += "<li><a href=\"" + fullUrl + " \" class=''>" + link.attributes.name.value + "</a></li>"
|
||||
});
|
||||
|
||||
console.log(innerContent)
|
||||
|
||||
let menu;
|
||||
menu = document.getElementById("menu-test-scroll-spy");
|
||||
|
||||
menu.innerHTML = innerContent
|
||||
|
||||
|
||||
// Activate Scrollspy
|
||||
$('.entry-content').scrollspy({
|
||||
target: '#nav_menu-4'
|
||||
});
|
||||
|
||||
// Refresh Scrollspy
|
||||
$('[data-spy="scroll"]').each(function () {
|
||||
$(this).scrollspy("refresh");
|
||||
});
|
||||
|
||||
});
|
||||
4
assets/js/editor.js
Normal file
4
assets/js/editor.js
Normal file
@@ -0,0 +1,4 @@
|
||||
wp.domReady ( function() {
|
||||
wp.blocks.unregisterBlockStyle( 'core/button', 'outline');
|
||||
wp.blocks.unregisterBlockStyle( 'core/button', 'fill');
|
||||
});
|
||||
Reference in New Issue
Block a user