Skip to content

Instantly share code, notes, and snippets.

@VelinGeorgiev
Last active February 25, 2020 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VelinGeorgiev/87a1535e12b2aca2b8d17f0f15692369 to your computer and use it in GitHub Desktop.
Save VelinGeorgiev/87a1535e12b2aca2b8d17f0f15692369 to your computer and use it in GitHub Desktop.
Hide see all on list item ootb web part using script editor
<script>
var maxAttempts = 100;
var currentAttempt = 0;
var hideListElements = function() {
// hide the see all urls
var seeAllUrls = window.document.querySelectorAll("a[data-automation-id='listViewWebPartSeeAll']");
var l = seeAllUrls.length;
while(l--) {
seeAllUrls[l].style.display = 'none';
}
// hide the list checkmarks
var allChecks = window.document.querySelectorAll("div[data-automationid='DetailsRowCheck']");
var l = allChecks.length;
while(l--) {
allChecks[l].style.display = 'none';
}
// hide the list sort arrows
var allArrows = window.document.querySelectorAll("i[data-icon-name='ChevronDown']");
var l = allArrows.length;
while(l--) {
allArrows[l].style.display = 'none';
}
// hide the header
var headers = window.document.querySelectorAll("div[data-automation-id='pageHeader']");
if(headers.length) {
headers[0].style.height= '5em';
}
}
var hideListElementsPerInterval = function() {
if(currentAttempt < maxAttempts) {
currentAttempt = currentAttempt + 1;
setTimeout(hideListElements, 300);
hideListElementsPerInterval();
}
}
console.log('Script editor loading...');
hideListElementsPerInterval();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment