summaryrefslogtreecommitdiffstats
path: root/client/lib/pasteImage.js
diff options
context:
space:
mode:
authorJustin Reynolds <justinr1234@gmail.com>2019-06-28 12:52:09 -0500
committerJustin Reynolds <justinr1234@gmail.com>2019-06-28 12:56:51 -0500
commit3eb4d2c341b712268bd321173909e0a7b19a88c9 (patch)
tree25a8fcb088f3984e72a5bd3ded9e6a45376e0693 /client/lib/pasteImage.js
parenta0a482aa8efb3255a523de4524c8e09453d5571f (diff)
downloadwekan-3eb4d2c341b712268bd321173909e0a7b19a88c9.tar.gz
wekan-3eb4d2c341b712268bd321173909e0a7b19a88c9.tar.bz2
wekan-3eb4d2c341b712268bd321173909e0a7b19a88c9.zip
Prettier & eslint project style update
Diffstat (limited to 'client/lib/pasteImage.js')
-rw-r--r--client/lib/pasteImage.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/client/lib/pasteImage.js b/client/lib/pasteImage.js
index 264d77ac..e6f8c6c2 100644
--- a/client/lib/pasteImage.js
+++ b/client/lib/pasteImage.js
@@ -11,7 +11,10 @@
$.event.fix = (function(originalFix) {
return function(event) {
event = originalFix.apply(this, arguments);
- if (event.type.indexOf('copy') === 0 || event.type.indexOf('paste') === 0) {
+ if (
+ event.type.indexOf('copy') === 0 ||
+ event.type.indexOf('paste') === 0
+ ) {
event.clipboardData = event.originalEvent.clipboardData;
}
return event;
@@ -23,7 +26,7 @@
matchType: /image.*/,
};
- return $.fn.pasteImageReader = function(options) {
+ return ($.fn.pasteImageReader = function(options) {
if (typeof options === 'function') {
options = {
callback: options,
@@ -35,8 +38,11 @@
return $(element).bind('paste', function(event) {
const types = event.clipboardData.types;
const items = event.clipboardData.items;
- for(let i=0; i<types.length; i++) {
- if(types[i].match(options.matchType) || items[i].type.match(options.matchType)) {
+ for (let i = 0; i < types.length; i++) {
+ if (
+ types[i].match(options.matchType) ||
+ items[i].type.match(options.matchType)
+ ) {
const f = items[i].getAsFile();
const reader = new FileReader();
reader.onload = function(evt) {
@@ -53,5 +59,5 @@
}
});
});
- };
+ });
})(jQuery);