V
V
Vova Vovin2018-07-31 14:14:22
JavaScript
Vova Vovin, 2018-07-31 14:14:22

How to disable swipe sidebars on specific pages in Framework7?

There is an application on framework 7. There is a main page index.html, from it there is a transition to other pages, example Both panels are initialized in js<a href="/about/" class="item-content item-link">

let app  = new Framework7({
    root: '#app', // App root element
    id: 'com.framework7.name', // App bundle ID
    name: 'Name', // App name
    theme: 'auto', // Automatic theme detection
    // App root data
    pushState: true,
    // App routes
    routes: routes,
    // Enable panel left visibility breakpoint
    panel: {
        swipe: 'both',
        leftBreakpoint: 960,
    },
});

The problem is that these panels can be pulled out with a swipe on any page, but you need to work only on the main page.
It is necessary either to allow only on the main one, or to prohibit the rest, how to do this?
Help, who knows pliz.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dreamerz, 2019-02-17
@dreamerz

A simple solution is to do app.panel.enableSwipe('left') on homepage.html
Don't forget to cut swipe:left from app.js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question