Show Files & Library Tabs

Problem: 

You want the Files and Library tabs to be visible when you browse to a page with multiple web parts.

Solution:

JavaScript! Add this to a Script Editor web part on the same page.


<script>

        setTimeout(function() {

        var elem = document.getElementById("MSOZoneCell_WebPartWPQ2");

           if(elem != null) {

                var dummyevent = new Array();

                dummyevent["target"] = elem;

                dummyevent["srcElement"] = elem;

                WpClick(dummyevent);

                _ribbonStartInit("Ribbon.Browse", true)

            }

        }, 2000);

        </script>

You may need to change “MSOZoneCell_WebPartWPQ2” to the web part ID of the web part you want to focus on. You can find this by opening dev tools.

f12-1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s