Skip to content

Commit

Permalink
Added copy to clipboard functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
tekmaven committed May 1, 2012
1 parent 7328792 commit 85909c9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
16 changes: 13 additions & 3 deletions SqlTools/Scripts/ListTool.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ $(document).ready () ->
text = text + "\n\'#{$.trim(line)}\'"
if i+1 != lines.length
text = text + ","
return $.trim(text)
,viewModel
text = $.trim(text)
return text
, viewModel

ko.applyBindings viewModel
viewModel.ProcessedTextThrottled = ko.computed(() ->
return @ProcessedText()
, viewModel).extend({ throttle: 500 });

ko.computed () ->
$('.clippy').clippy {text: @ProcessedTextThrottled(), clippy_path: '/Content/clippy.swf'}
, viewModel


ko.applyBindings viewModel
14 changes: 13 additions & 1 deletion SqlTools/Scripts/ListTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,19 @@
text = text + ",";
}
}
return $.trim(text);
text = $.trim(text);
return text;
}, viewModel);
viewModel.ProcessedTextThrottled = ko.computed(function() {
return this.ProcessedText();
}, viewModel).extend({
throttle: 500
});
ko.computed(function() {
return $('.clippy').clippy({
text: this.ProcessedTextThrottled(),
clippy_path: '/Content/clippy.swf'
});
}, viewModel);
return ko.applyBindings(viewModel);
});
Expand Down

0 comments on commit 85909c9

Please sign in to comment.