[v2] Plugin page callbacks not called on inline index page
See original GitHub issueThis is a (multiple allowed):
- bug
- enhancement
- feature-discussion (RFC)
- Framework7 Version: 2.0.5
- Platform and Target: Google Chrome on MacOS High Sierra
What you did
Tried to port upscroller plugin to v2.
Expected Behavior
When inline page “index” is opened, event pageBeforeIn
should be called. – At least in v1 this was the old behavior.
Actual Behavior
Event is not called. But when a new file about.html
with page name “about” is created and I open this page through a link <a class="link" href="/about/">to about</a>
, then pageBeforeIn
is called correctly.
Is this expected behavior or a bug?
Code Example
Test HTML
<div id="app">
<div class="view view-main">
<div class="pages">
<div data-name="index" class="page" data-page="index">
<div class="page-content main">
<a class="link" href="/about/">to page 2</a>
</div>
</div>
</div>
</div>
</div>
about.html
<div class="page" data-page="about">
<div class="page-content">
<p>About page</p>
</div>
</div>
Init code
Framework7.use(f7UpscrollerPlugin);
var app = new Framework7({
root: '#app',
upscroller: true,
routes: [{
path: '/about/',
url: 'about.html',
}],
});
var mainView = app.views.create('.view-main');
Plugin code
f7UpscrollerPlugin = {
name: 'upscroller',
params: {
text: 'Go up',
ignorePages: []
},
on: {
init: function() {
/*
This gets called correctly on app start. However, I miss
"page" parameter because I need to check if the current
page is listed in `app.params.ignorePages`.
*/
},
pageBeforeIn: function(page) {
// Not called for index page :-(
// But for "about" page this gets called correctly.
},
}
};
Issue Analytics
- State:
- Created 6 years ago
- Comments:17 (9 by maintainers)
Top Results From Across the Web
What are some reasons why callbacks fail to function after I ...
Based on the most recent video, I converted my app to a multi-page app. but the callbacks no longer fire. I've been working...
Read more >Callback is not called in add_settings_field() when passed as ...
I have a folder called SettingsAPI, with the following namespace namespace Blocks\Pages\SettingsAPI; Inside that folder, I have three files: AddSettings.php , ...
Read more >Multi-Page Dash App Callbacks Not Registering
When I go to my second page, the content loads fine but the callback does not, so selecting an item from the drop...
Read more >dash-labs/08-MultiPageDashApp.md at main - GitHub
This plugin allows users to simply place their layouts in pages/ and call dash.register_page with the desired URL path of that page. This...
Read more >Callback plugins - Ansible Documentation
By default, callback plugins control most of the output you see when running the command line programs, but can also be used to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, that was for example, refer to all router events list at https://framework7.io/docs/view.html#router-instance-events
@nolimits4web Ok, cool thanks Vladi 😄 👍