<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>bootstrap javascript lightbox fancybox on random thoughts</title><link>https://awesomeprogrammer.com/categories/bootstrap-javascript-lightbox-fancybox/</link><description>Recent content in bootstrap javascript lightbox fancybox on random thoughts</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Sun, 17 Feb 2013 00:00:00 +0000</lastBuildDate><atom:link href="https://awesomeprogrammer.com/categories/bootstrap-javascript-lightbox-fancybox/index.xml" rel="self" type="application/rss+xml"/><item><title>Bootstrap 2.3.0 and lightbox/fancybox crash issue</title><link>https://awesomeprogrammer.com/blog/2013/02/17/bootstrap-2-dot-3-0-and-lightbox-slash-fancybox-crash-issue/</link><pubDate>Sun, 17 Feb 2013 00:00:00 +0000</pubDate><guid>https://awesomeprogrammer.com/blog/2013/02/17/bootstrap-2-dot-3-0-and-lightbox-slash-fancybox-crash-issue/</guid><description><![CDATA[<p>After upgrading <a href="http://twitter.github.com/bootstrap/">bootstrap</a> to version 2.3.0 I spent an evening trying to figure out what&rsquo;s causing <em>too much recursion</em> error that was in the end crashing my entire browser when using lightbox or fancybox. Then I said - frak it, it&rsquo;s time to get some rest and in the morning I decided to visit github issues section first - and let me say I should start there, because there it was - waiting for me - exactly the same problem with possible solution :P. <a href="https://github.com/twitter/bootstrap/issues/6862">Issue #6862</a> is the right place for you. Thanks to the fellow programmer called <a href="https://github.com/Yohn">Yohn</a> I didn&rsquo;t had to waste no more time, so here we go:</p>
<p>You need to edit <code>dropdown.js</code> file and replace:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-js" data-lang="js"><span style="display:flex;"><span>.<span style="color:#a6e22e">on</span>(<span style="color:#e6db74">&#39;.dropdown-menu&#39;</span>, <span style="color:#66d9ef">function</span> (<span style="color:#a6e22e">e</span>) { <span style="color:#a6e22e">e</span>.<span style="color:#a6e22e">stopPropagation</span>() })
</span></span></code></pre></div><p>with:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-js" data-lang="js"><span style="display:flex;"><span>.<span style="color:#a6e22e">on</span>(<span style="color:#e6db74">&#39;click.dropdown-menu&#39;</span>, <span style="color:#66d9ef">function</span> (<span style="color:#a6e22e">e</span>) { <span style="color:#a6e22e">e</span>.<span style="color:#a6e22e">stopPropagation</span>() })
</span></span></code></pre></div><p>And that&rsquo;s it. If you are using Rails and <a href="https://github.com/thomas-mcdonald/bootstrap-sass">bootstrap-sass</a> gem - load only required js files in you <code>applicaion.js</code> and then clone <a href="https://github.com/thomas-mcdonald/bootstrap-sass/blob/master/vendor/assets/javascripts/bootstrap-dropdown.js">bootstrap-dropdown.js</a> to <code>vendor/assets/javascripts</code> directory, patch the file and load that patched one instead of original. This will to the trick until it is fixed (if it ever will, apparently third party tools are not supported by Boostrap, but I don&rsquo;t see the reason why should they break it on the way).</p>
]]></description><content:encoded><![CDATA[<p>After upgrading <a href="http://twitter.github.com/bootstrap/">bootstrap</a> to version 2.3.0 I spent an evening trying to figure out what&rsquo;s causing <em>too much recursion</em> error that was in the end crashing my entire browser when using lightbox or fancybox. Then I said - frak it, it&rsquo;s time to get some rest and in the morning I decided to visit github issues section first - and let me say I should start there, because there it was - waiting for me - exactly the same problem with possible solution :P. <a href="https://github.com/twitter/bootstrap/issues/6862">Issue #6862</a> is the right place for you. Thanks to the fellow programmer called <a href="https://github.com/Yohn">Yohn</a> I didn&rsquo;t had to waste no more time, so here we go:</p>
<p>You need to edit <code>dropdown.js</code> file and replace:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-js" data-lang="js"><span style="display:flex;"><span>.<span style="color:#a6e22e">on</span>(<span style="color:#e6db74">&#39;.dropdown-menu&#39;</span>, <span style="color:#66d9ef">function</span> (<span style="color:#a6e22e">e</span>) { <span style="color:#a6e22e">e</span>.<span style="color:#a6e22e">stopPropagation</span>() })
</span></span></code></pre></div><p>with:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-js" data-lang="js"><span style="display:flex;"><span>.<span style="color:#a6e22e">on</span>(<span style="color:#e6db74">&#39;click.dropdown-menu&#39;</span>, <span style="color:#66d9ef">function</span> (<span style="color:#a6e22e">e</span>) { <span style="color:#a6e22e">e</span>.<span style="color:#a6e22e">stopPropagation</span>() })
</span></span></code></pre></div><p>And that&rsquo;s it. If you are using Rails and <a href="https://github.com/thomas-mcdonald/bootstrap-sass">bootstrap-sass</a> gem - load only required js files in you <code>applicaion.js</code> and then clone <a href="https://github.com/thomas-mcdonald/bootstrap-sass/blob/master/vendor/assets/javascripts/bootstrap-dropdown.js">bootstrap-dropdown.js</a> to <code>vendor/assets/javascripts</code> directory, patch the file and load that patched one instead of original. This will to the trick until it is fixed (if it ever will, apparently third party tools are not supported by Boostrap, but I don&rsquo;t see the reason why should they break it on the way).</p>
]]></content:encoded></item></channel></rss>