Last active
April 1, 2017 18:20
-
-
Save miletskiy/78a5d43ce4dcdb5990f391ed693208cc to your computer and use it in GitHub Desktop.
for Alex
This file contains hidden or 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
| function (e) { | |
| e.preventDefault(); | |
| $(e.currentTarget).parent().remove(); // delete from ul | |
| return false; | |
| } | |
| // Corrected after review | |
| $("document").ready(function() { | |
| $("#fileUpload").on("change", function() { | |
| //here add functions | |
| var file = this.files[0]; | |
| var fileSize = file.size; | |
| var getFullName = $('#fileUpload').val(); | |
| var splitName = getFullName.split("\\"); | |
| var fileName = splitName[2]; | |
| var addFileString = $('<li class="uploadParams">' + fileName + " " + fileSize + "bytes" + | |
| // better to move into separate variable | |
| '<a href="javascript:return:void(0);" class="glyphicon glyphicon-remove-circle pull-right removeFile btn" aria-hidden="true">xxx</a>' + | |
| '</li>').appendTo('#fileList'); | |
| }); | |
| $('#fileList').on('click','a', function (e) { | |
| console.log($(e.currentTarget)); | |
| e.preventDefault(); | |
| $(e.currentTarget).parent().remove();// delete from ul | |
| return false; | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment