본문 바로가기
script

SharePoint ribbon default change

by [김경민]™ ┌(  ̄∇ ̄)┘™ 2014. 1. 24.
728x90


[출처] 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");


728x90

댓글