Toolbar: Figure out why _addBackButton() is called twice when the toolbar has fixed positioning #6567

Closed
gabrielschulhof opened this Issue Oct 4, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@gabrielschulhof
Contributor

gabrielschulhof commented Oct 4, 2013

I came across this issue while fixing #6554. The quick solution was to check if I had already instantiated the back button, but we need to check why the function _addBackButton() is getting called twice during toolbar instantiation.

It looks like _addBackButton() is getting called from _setOptions() both times, so we need to figure out why _setOptions() runs twice during instantiation. It should not run at all.

@rmcdaniel

This comment has been minimized.

Show comment
Hide comment
@rmcdaniel

rmcdaniel Oct 31, 2013

Contributor

I'm working on this now.

Contributor

rmcdaniel commented Oct 31, 2013

I'm working on this now.

@rmcdaniel

This comment has been minimized.

Show comment
Hide comment
@rmcdaniel

rmcdaniel Oct 31, 2013

Contributor

When I comment out this line, the issue disappears...

https://github.com/jquery/jquery-mobile/blob/master/js/widgets/fixedToolbar.js#L39

Obviously, this isn't a fix since now _makeFixed() is never called but it's getting us closer. Also, I see that _create() calls _makeFixed() and _makeFixed() calls _setOptions(), but _setOptions() calls _makeFixed() again. That doesn't seem right.

Contributor

rmcdaniel commented Oct 31, 2013

When I comment out this line, the issue disappears...

https://github.com/jquery/jquery-mobile/blob/master/js/widgets/fixedToolbar.js#L39

Obviously, this isn't a fix since now _makeFixed() is never called but it's getting us closer. Also, I see that _create() calls _makeFixed() and _makeFixed() calls _setOptions(), but _setOptions() calls _makeFixed() again. That doesn't seem right.

rmcdaniel pushed a commit to rmcdaniel/jquery-mobile that referenced this issue Oct 31, 2013

gabrielschulhof added a commit that referenced this issue Feb 7, 2014

Toolbar: Remove call to _setOptions from inside _makeFixed
Note by Gabriel Schulhof <gabriel.schulhof@intel.com>: Edited commit message to
comply with new style guide and replaced author with real name.

Fixes gh-6567

@gabrielschulhof gabrielschulhof added this to the 1.4.2 milestone Feb 13, 2014

@gabrielschulhof gabrielschulhof self-assigned this Feb 13, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment