couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From benk...@apache.org
Subject fauxton commit: updated refs/heads/master to 230e5f7
Date Wed, 21 Oct 2015 15:53:52 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 246057e64 -> 230e5f74e


Add callback to Clipboard component

This just adds a callback to the <Clipboard /> component that
gets called once the copy to clipboard action is completed.

Again, this is not testable due to Flash not being available
on the testing environment.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/230e5f74
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/230e5f74
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/230e5f74

Branch: refs/heads/master
Commit: 230e5f74ec8530284c1bd51200a2c343afae6eaa
Parents: 246057e
Author: Ben Keen <ben.keen@gmail.com>
Authored: Tue Oct 20 15:17:10 2015 -0700
Committer: Ben Keen <ben.keen@gmail.com>
Committed: Wed Oct 21 08:53:33 2015 -0700

----------------------------------------------------------------------
 app/addons/fauxton/components.react.jsx | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/230e5f74/app/addons/fauxton/components.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/components.react.jsx b/app/addons/fauxton/components.react.jsx
index caa829b..789413a 100644
--- a/app/addons/fauxton/components.react.jsx
+++ b/app/addons/fauxton/components.react.jsx
@@ -42,7 +42,8 @@ function (app, FauxtonAPI, React, ZeroClipboard) {
     getDefaultProps: function () {
       return {
         displayType: 'icon',
-        textDisplay: 'Copy'
+        textDisplay: 'Copy',
+        onClipboardClick: function () { }
       };
     },
 
@@ -60,6 +61,11 @@ function (app, FauxtonAPI, React, ZeroClipboard) {
     componentDidMount: function () {
       var el = this.getDOMNode();
       this.clipboard = new ZeroClipboard(el);
+      this.clipboard.on('load', function () {
+        this.clipboard.on('mouseup', function () {
+          this.props.onClipboardClick();
+        }.bind(this));
+      }.bind(this));
     },
 
     render: function () {


Mime
View raw message