Skip to content

Commit

Permalink
Fixed popover and iWebkit conflict (now the preventDefault works prop…
Browse files Browse the repository at this point in the history
…erly for popovers, simply add a class="noeffect" to other <a> links you wish to dodge the iWebkit refresh
  • Loading branch information
tomhodgins committed Feb 22, 2013
1 parent fd2d1c0 commit 587f5ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/boilerstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ $( document ).ready(function() {
$('a[data-toggle=tooltip-down]').tooltip({placement: 'bottom'})

// Inititialize Bootstrap's popovers
$("a[data-toggle=popover]").popover({html: 'true', placement: 'top'}).click(function(e) {e.preventDefault(); });
$("a[data-toggle=popover-left]").popover({html: 'true', placement: 'left'}).click(function(e) {e.preventDefault(); });
$("a[data-toggle=popover-right]").popover({html: 'true', placement: 'right'}).click(function(e) {e.preventDefault(); });
$("a[data-toggle=popover-down]").popover({html: 'true', placement: 'bottom'}).click(function(e) {e.preventDefault(); });
$("a[data-toggle=popover]").popover({html: 'true', placement: 'top'}).click(function(e) {e.preventDefault().addClass("noeffect"); });
$("a[data-toggle=popover-left]").popover({html: 'true', placement: 'left'}).click(function(e) {e.preventDefault().addClass("noeffect"); });
$("a[data-toggle=popover-right]").popover({html: 'true', placement: 'right'}).click(function(e) {e.preventDefault().addClass("noeffect"); });
$("a[data-toggle=popover-down]").popover({html: 'true', placement: 'bottom'}).click(function(e) {e.preventDefault().addClass("noeffect"); });

// iWebkit support for offline apps on Mobile
var iWebkit;if(!iWebkit){iWebkit=window.onload=function(){function fullscreen(){var a=document.getElementsByTagName("a");for(var i=0;i<a.length;i++){if(a[i].className.match("noeffect")){}else{a[i].onclick=function(){window.location=this.getAttribute("href");return false}}}}function hideURLbar(){window.scrollTo(0,0.9)}iWebkit.init=function(){fullscreen();hideURLbar()};iWebkit.init()}}
Expand Down

0 comments on commit 587f5ea

Please sign in to comment.