Cannot really JSFiddle this, but this fiddle can give the idea: http://jsfiddle.net/xBc5a/ GCT = Google Closure Tools
<nav class="navbar navbar-inverse navbar-fixed-top role=navigation">
<div id="navbar-container" class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Codeshelf</a>
<a class="navbar-brand" href="#"><img src="favicon.gif" width="24" height="24"></a>
</div>
<!-- links, dropdowns -->
</div>
<!-- /.container -->
</nav>
On that, no drop downs or links for simplicity, but you see the collapse functionality. - Make window very wide: no button on the right. - Make window narrower, and the navbar "collapses", giving the button on the right. - Make window wide again, and the button on the right disappears. (If there were drop downs and links, they would come back on the navbar.)
The complaint is this: Using Bootstrap 3.0.3 in my application, and GCT, the compile process breaks the navbar as described next: - Make window wider or narrower. Works ok. When wide, the drop downs and links work. - However, once you touch the button in collapsed mode, the navbar gets broken. -- The links and drop downs do not come. -- And once the window goes wide again, the collapsed button remains. All functionality is lost.
If I do not do the GCT compile, the functionality is perfect. I would guess that in Bootstrap javascript code, there need to be some externs or goog.exportSymbol() defined. Has anyone figured out how to make navbar work with compiled GCT?
More information: May 1
I changed to a non-collapsing navbar as follows:
<div class="navbar-header">
<!-- comment out the collapse button until it works in compiled code
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
-->
And also change the navbar collapse class to something that twitter css does not have
<!-- <div class="navbar-collapse collapse"> -->
<div class="mystaticnavbar">
The result "works" as expected for compiled or uncompiled. The navbar still transforms on narrower screen, but it does not collapse to the single button. Rather, the links and drop downs (missing in the fiddle) come vertically left, as in the expanded mobile format. Not good as the navbar is hiding much of the available page. But at least this does not lose all functionality when clicked. (Only if closure-compiled.)
All that to say, the problem is most likely isolated to the button.