0

I have a master page that will be wrapped around custom .NET coding, and does not need ribbon or web part dependencies.

Is there a clean and easy way from the .html master page in sharepoint 2013 to either customize or remove the init.js process so that .NET developers can go to town? scrolltop code in sharepoint's init.js file, is colliding with our custom form application processes.

this code within init.js is out of control...

if (!g_setScrollPos) {
        if (browseris.firefox && browseris.firefox36up)
            window.scrollTo(0, 0);
        if (Boolean((ajaxNavigate.get_search()).match(RegExp("[?&]IsDlg=1")))) {
            if (!isIE7 || elmWorkspace.scrollHeight < elmWorkspace.clientHeight)
                elmWorkspace.style.overflowY = "auto";
        }
        var scrollElem = document.getElementById("_maintainWorkspaceScrollPosition");

        if (scrollElem != null && scrollElem.value != null) {
            elmWorkspace.scrollTop = Number(scrollElem.value);
        }
        g_setScrollPos = true;
    }
    CallWorkspaceResizedEventHandlers();
    g_frl = false;

...when you attempt to apply a postback action on a link. no matter what you do, on setting the postback parameters, on submit, the page does not go back to the top of the window, but stays at the same position.

If this code was explicitly for the ribbon, then why not set ribbon only parameters around it?

0

You could create your own JavaScript file and have it overload the methods you need to modify. Make sure your JavaScript file is loaded after init.js

  • Not sure how effective that would be since JavasScript does not naturally overload methods...and in addition, the issue is occurring on a postback event, not on page load. – klewis Oct 10 '16 at 14:06

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.