Master Detail Page Default

This is what it looks like before selecting an item.

After selecting an item:

I want it to return to its initial (empty) state by adding a button to the master detail page.

I tried removing the page-master-detail element but that’s why you can’t touch anything on the previous screen on mobile.

I found a solution:

if ($(".view-main").hasClass("view-master-detail")) { // For big screens
} else // For small screens