The +Add new link button is broken for me
https://blot.im/sites/mysitename/template/magazine/links
Won't let me add a new link. Not sure if I need to add the link through my pages folder instead, just trying to add a link to my main site. Thanks!
I figured it out it's due to the jQuery event listener being added before the element exists on the page (bad order of operations). So, temporary workaround is to copy & paste the event listener logic back into the page after it's loaded.
- Open up the browser devtools
- Go to the Console tab
- Paste in the following (which was copied from the page source code itself)
$("#add").click(function (e) {
var index = $("#menu section").length;
var linkID = new Date().getTime();
var newlink = $("#link_").clone().removeAttr("style");
$("#emptyMenu").hide();
newlink
.attr("id", function (el, val) {
return val + linkID;
})
.find("input")
.removeAttr("disabled")
.end()
.find('input[name*="{index}"]')
.attr("name", function (i, val) {
return val.split("{index}").join(index);
})
.end()
.find('input[value*="{id}"]')
.attr("value", function (i, val) {
return val.split("{id}").join(linkID);
})
.end();
newlink.appendTo("#menu");
$('[name="title_' + linkID + '"]').focus();
e.preventDefault();
return false;
});
Answered 5 months ago ·
Edit answer