Need to intercept Project Online Save Button. To perform some action before Project Server update starts. Once my action is successful, I would like original code of Project Server Save to take over.

Below is the Original HTML available

<a class="ms-cui-ctl-large " id="Ribbon.Tabs.PDP.Home.Project.Save-Large" onclick="return false;" href="javascript:;" mscui:controltype="Button" aria-describedby="Ribbon.Tabs.PDP.Home.Project.Save_ToolTip" role="button" unselectable="on"><span class="ms-cui-ctl-largeIconContainer" unselectable="on"><span class=" ms-cui-img-32by32 ms-cui-img-cont-float ms-cui-imageDisabled" unselectable="on"><img class="" style="top: -32px;left: -320px;" unselectable="on" src="/_layouts/15/1033/images/ps32x32.png?rev=45" data-themekey="#"></span></span><span class="ms-cui-ctl-largelabel" unselectable="on">Save</span></a>

Also, I have tried addEventListener as below

document.body.addEventListener('click', function( event ) { if(event.target.id=="Ribbon.Tabs.PDP.Home.Project.Save-Large"){ console.log('mouse button click: ', event.target.id); SaveData(_defaultVal,projectName,_curTAB); } }, false);

But unfortunately, I was unable to intercept the save click. However, If i try mouseover it is working fine.

Any idea ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.