SharePoint 2013 - FILES and LIBRARY tabs disappear from the ribbon menu when adding a web part

You can see “FILES” and “LIBRARY” tabs on the default list view page.
image
If you add a web part (like Content Editor Web Part) on the page, the tabs disappear.
image
Ribbon menus are connected with the focused web part. If there are several web parts on the page, you cannot get a focus on the list view web part.

Solution
  1. Click an item on the library. the tabs appear.image
  2. Edit the ListViewWebPart and select ‘Show Toolbar‘ as the toolbar type. You can see the toolbar above the items.imageimage
  3. add a Content Editor Web Part with this code:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
References