diff --git a/resources/js/dashboard.js b/resources/js/dashboard.js index 4f7b42a..c6fbf5e 100644 --- a/resources/js/dashboard.js +++ b/resources/js/dashboard.js @@ -324,6 +324,7 @@ function editItemInit() { $datePickers = $(".date-picker"), $mkdEditors = $(".mkd-editor"), $lists = $(".list"), + $clearUploadButtons = $(".clear-upload"), $token = $("#token"), model = $editItem.data("model"), operation = $editItem.data("id") === "new" ? "create" : "update"; @@ -524,6 +525,14 @@ function editItemInit() { $submit.removeClass("no-input"); }; + // initialize upload clearing buttons + $clearUploadButtons.on("click", function(e) { + const $this = $(this), + $upload = $this.parent().find("input").first(); + + $upload.val(""); + }); + // initialize image deletion $(".edit-button.delete.image").on("click", function(e) { const $this = $(this), diff --git a/resources/sass/dashboard.scss b/resources/sass/dashboard.scss index 0ff6433..86b0533 100644 --- a/resources/sass/dashboard.scss +++ b/resources/sass/dashboard.scss @@ -1175,6 +1175,35 @@ form { max-width: 100%; font-size: pxrem(14); } + + .clear-upload { + position: relative; + transform: rotate(45deg); + width: pxrem(20); + height: pxrem(20); + padding: 0px; + border: 0; + background-color: transparent; + + &:before, &:after { + content: ""; + position: absolute; + top: 50%; + left: 50%; + transform: translateX(-50%) translateY(-50%); + background-color: $c-dashboard-error; + } + + &:before { + width: 2px; + height: 50%; + } + + &:after { + width: 50%; + height: 2px; + } + } } textarea { diff --git a/resources/views/dashboard/pages/edit-item.blade.php b/resources/views/dashboard/pages/edit-item.blade.php index 71bf786..dd8256a 100644 --- a/resources/views/dashboard/pages/edit-item.blade.php +++ b/resources/views/dashboard/pages/edit-item.blade.php @@ -163,7 +163,7 @@ @endphp
- +
@if(file_exists(base_path() . '/public' . $current_image)) @@ -183,7 +183,7 @@ @endphp
- +
@if(file_exists(base_path() . '/public' . $current_file))