Hide Download a Copy option from Ribbon and ECB SharePoint 2010 Document Library
Hey if you want to remove "Download a copy" option from SharePoint 2010 document library then add the below code.
Now it depends on the requirement
1. If it has to be disabled in specific library only then add a content editor web part and add the below code as html.
2. if it has to be disabled throughout the site then it is recommended to put it in the Master page.
The Css hides the icon in the ribbon whereas the JavaScript overrides the default function of ECB to render the Send To option.
<style type="text/css" >
a[id$='Ribbon.Documents.Copies.Download-Large'] {
display:none;
}
</style>
<script type="text/javascript">
AddSendSubMenu = function (m,ctx) {}
_spBodyOnLoadFunctionNames.push("resetAddSendSubMenu()");
function resetAddSendSubMenu(){
AddSendSubMenu = function (m,ctx) {};
}
</script>
Now it depends on the requirement
1. If it has to be disabled in specific library only then add a content editor web part and add the below code as html.
2. if it has to be disabled throughout the site then it is recommended to put it in the Master page.
The Css hides the icon in the ribbon whereas the JavaScript overrides the default function of ECB to render the Send To option.
<style type="text/css" >
a[id$='Ribbon.Documents.Copies.Download-Large'] {
display:none;
}
</style>
<script type="text/javascript">
AddSendSubMenu = function (m,ctx) {}
_spBodyOnLoadFunctionNames.push("resetAddSendSubMenu()");
function resetAddSendSubMenu(){
AddSendSubMenu = function (m,ctx) {};
}
</script>
Comments
Post a Comment