Created
November 23, 2012 10:56
-
-
Save yurikoval/4135113 to your computer and use it in GitHub Desktop.
Show bookmark me on iPad
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# enable with: | |
# | |
# - content_for :head do | |
# :javascript | |
# window.enable_home_bookmark = true | |
$ -> | |
if window.enable_home_bookmark && (("undefined" != typeof window.navigator.standalone) && !window.navigator.standalone) && navigator.userAgent.match(/iPad/i) != null | |
$('<div id="home_bookmark" style="position:fixed; top: 60px; left: 155px;" ></div>').appendTo('body').popover( | |
placement: 'bottom' | |
trigger: 'manual' | |
html: true | |
title: '<center>Bookmark Me!</center>' | |
content: '<div id="home_bookmark_content"><center>Click on <i class="icon-share"></i> above and bookmark.</center></div>' | |
).popover 'show' | |
$('#home_bookmark_content').parents('.popover').find('.arrow').css('border-bottom-color', 'white') | |
$('<div class="modal-backdrop in" style="z-index: 1009;"></div>').appendTo('body').on 'click', -> | |
$('#home_bookmark').popover 'hide' | |
$(@).hide().remove() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment