Created
March 27, 2020 12:54
-
-
Save ichaykin/cc1c50a7674871fc204dd185ef4bd9c7 to your computer and use it in GitHub Desktop.
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/js/tygh/file_uploader.js b/js/tygh/file_uploader.js | |
index b14be17..d9947e5 100644 | |
--- a/js/tygh/file_uploader.js | |
+++ b/js/tygh/file_uploader.js | |
@@ -36,7 +36,9 @@ | |
value: function () { | |
for (var i = 0; i < this.length; i++) { | |
if (this[i].image_type === 'M') { | |
- return this[i]; } } | |
+ return this[i]; | |
+ } | |
+ } | |
return false; | |
}, | |
@@ -453,6 +455,7 @@ | |
} | |
self.refreshPreview(addedFile); | |
self.registerCustomRemoveEvent(addedFile); | |
+ self.registerCustomAltUpdateEvent(addedFile); | |
self.expandAltTextarea(addedFile); | |
}); | |
}, | |
@@ -608,6 +611,15 @@ | |
}); | |
}, | |
+ registerCustomAltUpdateEvent: function (file) { | |
+ var self = this; | |
+ | |
+ $(file.previewElement).find('.file-uploader__file-description-input').on('keyup', function () { | |
+ file.dynamicData['alt-text-detailed'].value = $(this).val(); | |
+ self.refreshPreview(file); | |
+ }); | |
+ }, | |
+ | |
refreshPreview: function (previewFile) { | |
if ('dynamicData' in previewFile) { | |
var self = this; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment