This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class Clipboard { | |
constructor(target) { | |
this._target = target; | |
this._eventHandlers = { | |
'copy': this._handleCopy.bind(this), | |
'paste': this._handlePaste.bind(this) | |
}; | |
// ===== EVENT HANDLERS ===== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core/clipboard.js b/core/clipboard.js | |
new file mode 100644 | |
index 0000000..a4a6813 | |
--- /dev/null | |
+++ b/core/clipboard.js | |
@@ -0,0 +1,46 @@ | |
+export default class Clipboard { | |
+ constructor(target) { | |
+ this._target = target; | |
+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button id=submit>Submit</button> | |
<div id=log style='white-space: pre'></div> | |
<script> | |
const button = document.getElementById('submit'); | |
button.addEventListener('mousedown', () => { | |
print('1. down'); | |
Promise.resolve().then(() => print('2. down task ends')); | |
}); | |
button.addEventListener('mouseup', () => { | |
print('3. up'); |