You are viewing limited content. For full access, please sign in.

Question

Question

How to hide Entry Properties in Weblink 10?

asked on December 26, 2019

The code that was provided at the last Empower Conference works great, however, some of our customers don't like that the Entry Properties display for a brief second before becoming hidden. Is there a way to hide them completely? Here is what we have currently:

 

$(document).ready(function () {
var i = 1;
function removeEntryPropertyLoop() {
setTimeout(function () {
if ($('.mTitle[lflocalize=STR_MODIFIED]').length > 0) {
$('.mTitle[lflocalize=STR_MODIFIED]').parent().parent().remove();
$('.mTitle[lflocalize=STR_CREATED]').parent().parent().remove();
$('.mTitle[lflocalize=STR_PATH]').parent().parent().remove();

return; // exit loop
}
i++;
if (i < 20) {
removeEntryPropertyLoop();
}
}, 500);
}
removeEntryPropertyLoop();
});

 

0 0

Replies

replied on February 3, 2020 Show version history

Hi,

While there's no way to hide them completely, you could try a shorter wait period than 500 milliseconds - maybe change the "500" to "100".  You could also change the "20" to "100" to allow the loop to run for the same amount of time in case the page is slow to load.  So the function would look like:

function removeEntryPropertyLoop() {
    setTimeout(function () {
        if ($('.mTitle[lflocalize=STR_MODIFIED]').length > 0) {
            $('.mTitle[lflocalize=STR_MODIFIED]').parent().parent().remove();
            $('.mTitle[lflocalize=STR_CREATED]').parent().parent().remove();
            $('.mTitle[lflocalize=STR_PATH]').parent().parent().remove();

             return; // exit loop
        }
        i++;
        if (i < 100) {
            removeEntryPropertyLoop();
        }
    }, 100);
}

This means that every 1/10 of a second, the code will look for the relevant part of the page.  If it's found, it will be deleted and the function will return.  If not, it'll wait another 1/10 of a second and try again; if it doesn't find it after 100 tries (10 seconds), it'll give up.

Melanie

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.