Created
January 7, 2014 21:41
-
-
Save daniel-nelson/8307420 to your computer and use it in GitHub Desktop.
If the top or left edge of an Adobe Flash object in a web page is aligned on a fraction of a pixel, the camera and microphone permission buttons are unclickable. They are also (or at least used to be) unclickable when the browser window is zoomed in or out. This CoffeeScript method adjusts the offset to place the upper-left corner on an integer …
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
fixFlashMargin: => | |
$recorder = @modalContainer().find('.asset_editor_modal_container object') | |
offset = $recorder.offset() | |
$recorder.offset | |
top: Math.round(offset.top) | |
left: Math.round(offset.left) | |
# https://github.com/tombigel/detect-zoom | |
# Apparently detect-zoom is no longer reliable | |
if DetectZoom.ratios().zoom != 1 | |
key = if $('html').hasClass('mac') then 'Command' else 'Control' | |
alert("""<div class="alert alert-error">Your browser is zoomed. Press #{key}+0 to un-zoom.</div>""") | |
else if r.zoom == 1 and @warningDisplayed() | |
@modalContainer().find('.asset_editor_modal_container .alert-error').remove() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment