[V2] Can't modify IOS title in navbar
This is a (multiple allowed):
-
[x] bug
-
[ ] enhancement
-
[ ] feature-discussion (RFC)
-
Framework7 Version: V2.0.6
-
Platform and Target: IOS
I'm filing this as a bug but I hope there is a reasonable explanation. This perhaps need a documentation update.
I try to modify the navbar title dynamically (page.$el.find('#title').text('new title')) which works fine in the MD theme but not in the IOS theme (null is returned). Under closer inspection, the navbar is not located within the page container but was moved under the view.
My navbar markup is
<div class="navbar">
<div class="navbar-inner sliding">
<div class="left">
<a href="/" class="link">
<i class="icon icon-back"></i>
<span class="ios-only">Home</span>
</a>
</div>
<div class="title" id="title">Event</div>
<div class="right">
<!--
Right link contains only icon - additional "icon-only" class
Additional "open-panel" class tells app to open panel when we click on this link
-->
<a href="#" class="link icon-only panel-open"><i class="f7-icons ios-only">bars</i><i class="material-icons md-only">menu</i></a>
</div>
</div>
</div>
Is this correct? If so, then the navabar mod can't be done with 1 common function call.
It's not a bug, it's feature. With iOS theme .navbar is moved out page container to parent (view)
page.$el.parent().find('#title').text('new title'))
has to work with any themes.
Ok, like I mentioned, perhaps the documentation should note that.
http://framework7.io/docs/navbar.html#navbar-app-methods app.navbar.getElByPage