framework7 icon indicating copy to clipboard operation
framework7 copied to clipboard

[V2] Can't modify IOS title in navbar

Open eradin opened this issue 8 years ago • 3 comments

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.

eradin avatar Jan 11 '18 19:01 eradin

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.

softexe avatar Jan 12 '18 04:01 softexe

Ok, like I mentioned, perhaps the documentation should note that.

eradin avatar Jan 12 '18 06:01 eradin

http://framework7.io/docs/navbar.html#navbar-app-methods app.navbar.getElByPage

nolimits4web avatar Jan 12 '18 06:01 nolimits4web