SharePoint ribbon default change

script 2014. 1. 24. 17:52


[출처] http://paulbuzzblog.wordpress.com/2012/11/23/how-to-hide-the-sharepoint-ribbon/


function hideEditRibbon() {
var ribbon = SP.Ribbon.PageManager.get_instance().get_ribbon();
// Set the tab to the “Browse” tab
SelectRibbonTab("Ribbon.Read", true);
// Remove the “Edit” tab from a list from from the ribbon.
ribbon.removeChild('Ribbon.ListForm.Edit');
}

SP.SOD.executeOrDelayUntilScriptLoaded(function() {

var pm = SP.Ribbon.PageManager.get_instance();

pm.add_ribbonInited(function() {
hideEditRibbon();
});

var ribbon = null;
try {
ribbon = pm.get_ribbon();
}
catch (e) { }

if (!ribbon) {
if (typeof(_ribbonStartInit) == "function")
_ribbonStartInit(_ribbon.initialTabId, false, null);
}
else {
hideEditRibbon();
}
},
"sp.ribbon.js");


Trackbacks 0 : Comments 0

Write a comment