Ditching Flash for copy/paste
parent
8fa65efb27
commit
68c5d405d2
|
@ -11,39 +11,21 @@
|
|||
this.$el = $(this.el);
|
||||
this.$aside = $('aside', this.$el);
|
||||
this.$container = $('div.container', this.$el);
|
||||
this.$copy_button = $('a.copy', this.$aside);
|
||||
this.$copy_do = $('span.do', this.$copy_button);
|
||||
this.$copy_done = $('span.done', this.$copy_button);
|
||||
this.$expand_button = $('a.expand', this.$aside);
|
||||
this.$raw = $('div.raw', this.$container);
|
||||
this.$tags = $('section.tags ul', this.$aside);
|
||||
|
||||
this.setupCopy();
|
||||
},
|
||||
events: {
|
||||
'click a.expand': 'expand'
|
||||
'click a.expand': 'expand',
|
||||
'click a.copy': 'copy'
|
||||
},
|
||||
expand: function() {
|
||||
this.$container.toggleClass('expanded', 100);
|
||||
this.$tags.toggleClass('expanded');
|
||||
return false;
|
||||
},
|
||||
setupCopy: function() {
|
||||
|
||||
var copy_do = this.$copy_do;
|
||||
var copy_done = this.$copy_done;
|
||||
|
||||
//this.$copy_button.zclip({
|
||||
//afterCopy: function() {
|
||||
//copy_do.hide();
|
||||
//copy_done.fadeIn(500);
|
||||
//setTimeout(function() {
|
||||
//copy_done.hide();
|
||||
//copy_do.fadeIn(500);
|
||||
//}, 1500);
|
||||
//},
|
||||
//copy: this.$raw.text()
|
||||
//});
|
||||
copy: function() {
|
||||
window.prompt('Text is selected. To copy: press Ctrl+C then <Enter>', this.$raw.text());
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue