Skip to content

Instantly share code, notes, and snippets.

@zeppelin
Created January 12, 2014 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save zeppelin/8383365 to your computer and use it in GitHub Desktop.
Save zeppelin/8383365 to your computer and use it in GitHub Desktop.
App.IndexView = Ember.View.extend({
bindCopyButton: function() {
var self = this;
var controller = this.get('controller');
var copyButton = this.$('.copy-button');
var clip = new ZeroClipboard(copyButton);
clip.on('dataRequested', function (client, args) {
client.setText(document.location.href);
controller.set('justCopied', true);
setTimeout(function() {
controller.set('justCopied', false);
Ember.run.next(function(){
self.bindCopyButton();
});
}, 1500);
});
}.on('didInsertElement');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment