Merge pull request #1152 from okriuchykhin/ok_SCI_2403

Change remove file button appearence [SCI-2403]
This commit is contained in:
okriuchykhin 2018-05-18 17:34:56 +02:00 committed by GitHub
commit 6dbb5bc583
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View file

@ -1036,16 +1036,16 @@ var RepositoryDatatable = (function(global) {
// Takes object and surrounds it with input // Takes object and surrounds it with input
function changeToInputFileField(object, name, value) { function changeToInputFileField(object, name, value) {
return "<div class='repository-input-file-field'>" + return "<div class='repository-input-file-field'><div class='form-group'>" +
"<input type='file' class='form-control' data-object='" + "<input type='file' class='form-control' data-object='" +
object + "' name='" + name + "' value='" + value + "'>" + object + "' name='" + name + "' value='" + value + "'></div>" +
"<a class='btn btn-danger' onClick='clearFileInput(this)'>" + "<a onClick='clearFileInput(this)'>" +
"<i class='fas fa-times'></i>" + "<i class='fas fa-times'></i>" +
"</a></div>"; "</a></div>";
} }
global.clearFileInput = function (el) { global.clearFileInput = function (el) {
$(el).prev('input:file')[0].value = ''; $(el).prev('div').find('input:file')[0].value = '';
} }
// Takes an object and creates custom html element // Takes an object and creates custom html element

View file

@ -38,7 +38,8 @@
.repository-input-file-field { .repository-input-file-field {
display: inline-flex; display: inline-flex;
.btn-danger { a {
color: $brand-danger;
margin-left: 5px; margin-left: 5px;
} }
} }