Created
July 25, 2013 16:04
-
-
Save jondkinney/6081225 to your computer and use it in GitHub Desktop.
This file contains 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
$ -> | |
$('#entry_description').simplyCountable() | |
$(document).on "mouseover", "*[data-zc-copy-value]", -> | |
that = $(this) | |
width = that.outerWidth() | |
height = that.outerHeight() | |
if that.data("zc-activated") isnt "true" | |
# init new ZeroClipboard client | |
clip = new ZeroClipboard.Client() | |
clip.setHandCursor true | |
clip.setText that.data("zc-copy-value") | |
flash_movie = "<div>" + clip.getHTML(width, height) + "</div>" | |
# make your own div with your own css property and not use clip.glue() | |
flash_movie = $(flash_movie).css( | |
position: "relative" | |
marginTop: -height | |
width: width | |
height: height | |
zIndex: that.css("zIndex") + 1 | |
) | |
# delegate mouse states (use the .hover/.active class instead of :hover/:active) | |
flash_movie.hover(-> | |
that.addClass "hover" | |
, -> | |
that.removeClass "hover" | |
).mousedown(-> | |
that.addClass "active" | |
index_val = that.data("index-value") | |
console.log index_val | |
$(".copy_text#{index_val}").text("Emails Copied") | |
).mouseup -> | |
that.removeClass "active" | |
# add flash overlay | |
# if you want to put before and not after, then you have to change the marginTop to marginBottom | |
that.after(flash_movie).data "zc-activated", "true" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment