fixes per @mlorb 's request

This commit is contained in:
zmagod 2018-07-09 12:54:02 +02:00
parent dd00de928c
commit 14254fbde3
3 changed files with 8 additions and 7 deletions

View file

@ -24,10 +24,10 @@
* @returns {undefinded} * @returns {undefinded}
*/ */
RepositoryItemEditForm.prototype.renderForm = function(table) { RepositoryItemEditForm.prototype.renderForm = function(table) {
var colIndex = getColumnIndex(table, '#row-name'); var colIndex = getColumnIndex(table, '#row-name');
var cells = this.itemData.repository_row.repository_cells; var cells = this.itemData.repository_row.repository_cells;
var listColumns = this.itemData.repository_row.repository_column_items; var listColumns = this.itemData.repository_row.repository_column_items;
var formData = this.formData; var formData = this.formData;
if (colIndex) { if (colIndex) {
$(this.repositoryItemElement).children('td').eq(colIndex) $(this.repositoryItemElement).children('td').eq(colIndex)
@ -194,7 +194,7 @@
"' data-id='" + id + "'>" + buttonLabel + "' data-id='" + id + "'>" + buttonLabel +
"</button></div><div><p class='file-name-label'>" + fileName + "</button></div><div><p class='file-name-label'>" + fileName +
"</p></div>"; "</p></div>";
if(fileName.length > 0) { if(value.file_file_name) {
html += "<div><a data-action='removeAsset' "; html += "<div><a data-action='removeAsset' ";
html += "onClick='clearFileInput(this)'><i class='fas fa-times'></i></a>"; html += "onClick='clearFileInput(this)'><i class='fas fa-times'></i></a>";
} else { } else {

View file

@ -1070,13 +1070,13 @@ 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 new-input-file-field-div'>"+ return "<div class='repository-input-file-field'>"+
"<div class='form-group'>" + "<div class='new-input-file-field-div'><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 + "'></div>" + object + "' name='" + name + "' value='" + value + "'></div>" +
"<a onClick='clearFileInput(this)'>" + "<a onClick='clearFileInput(this)'>" +
"<i class='fas fa-times'></i>" + "<i class='fas fa-times'></i>" +
"</a></div>"; "</a></div></div>";
} }
global.clearFileInput = function (el) { global.clearFileInput = function (el) {

View file

@ -40,6 +40,7 @@
} }
.repository-input-file-field { .repository-input-file-field {
width: auto;
.form-group { .form-group {
align-items: baseline; align-items: baseline;
border: 1px solid $color-alto; border: 1px solid $color-alto;