Log in Sign up

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!


2 months ago, 4 replies   Edit question

I noticed the same a couple of days ago.

Answered 3 months ago · Edit answer

If it helps same here!

Answered 3 months ago · Edit answer

Same here!

Answered 3 months ago · Edit answer

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.

  1. Open up the browser devtools
  2. Go to the Console tab
  3. 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 2 months ago · Edit answer