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
    $(".page-master").removeClass("page-previous").addClass("page-current");
    $f7router.history.pop();
    $(".page-master-detail").remove();
} else // For small screens
    $f7router.back();