Skip to content

Commit

Permalink
added onCopy nanoflow events
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Jansen committed Dec 24, 2020
1 parent 179597d commit 267171e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/ClipboardTextCopy/ClipboardTextCopy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
<category>General</category>
<description>Class name of the input or html element. Input element value will be copied, other elements the inner text is copied</description>
</property>
<property key="onCopyNanoflow" type="nanoflow" required="false">
<caption>OnCopy Nanoflow</caption>
<category>Events</category>
<description>Nanoflow to execute after content is copied to clipboard</description>
<returnType type="Void" />
</property>
<property key="labelCaption" type="translatableString" required="false">
<caption>Caption</caption>
<category>Appearance</category>
Expand Down
10 changes: 10 additions & 0 deletions src/ClipboardTextCopy/widget/ClipboardTextCopy.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ define([
? element.value
: element.innerText;
this.copyToClipboard(value);
if(this.onCopyNanoflow.nanoflow !== undefined){
mx.data.callNanoflow({
nanoflow: this.onCopyNanoflow,
origin: this.mxform,
context: this.mxcontext,
error: function(error) {
console.log(error.message);
}
});
}
}
},

Expand Down
Binary file modified test/Test.mpr
Binary file not shown.
Binary file modified test/widgets/ClipboardTextCopy.mpk
Binary file not shown.

0 comments on commit 267171e

Please sign in to comment.