1var FormDropzone = function () { 2 3 4 return { 5 //main function to initiate the module 6 init: function () { 7 8 Dropzone.options.myDropzone = { 9 10 11 init: function() { 12 this.on("addedfile", function(file) { 13 // Create the remove button 14 var removeButton = Dropzone.createElement("<button class='btn btn-sm btn-block'>Remove file</button>"); 15 16 // Capture the Dropzone instance as closure. 17 var _this = this; 18 19 // Listen to the click event 20 removeButton.addEventListener("click", function(e) { 21 // Make sure the button click doesn't submit the form: 22 e.preventDefault(); 23 e.stopPropagation(); 24 25 // Remove the file preview. 26 _this.removeFile(file); 27 // If you want to the delete the file on the server as well, 28 // you can do the AJAX request here. 29 }); 30 31 // Add the button to the file preview element. 32 file.previewElement.appendChild(removeButton); 33 }); 34 } 35 } 36 } 37 }; 38}();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.