Skip to content

Instantly share code, notes, and snippets.

@yurikoval
Created November 23, 2012 10:56
Show Gist options
  • Save yurikoval/4135113 to your computer and use it in GitHub Desktop.
Save yurikoval/4135113 to your computer and use it in GitHub Desktop.
Show bookmark me on iPad
# 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