Skip to content

Commit

Permalink
reset file choose button to default
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriyAndriyovuch committed Nov 9, 2023
1 parent 45a57d1 commit bfb5741
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 25 deletions.
19 changes: 0 additions & 19 deletions app/assets/stylesheets/pages/site_setting.scss

This file was deleted.

3 changes: 1 addition & 2 deletions app/javascript/controllers/handle_browser_tab_controller.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Controller } from '@hotwired/stimulus'

export default class extends Controller {
static targets = ["title", "icon", "faviconFile"]
static targets = ["title", "icon"]


setTitle(event) {
Expand All @@ -16,7 +16,6 @@ export default class extends Controller {
this.iconTarget.setAttribute('src', e.target.result);
};

this.faviconFileTarget.textContent = event.target.files[0].name;
reader.readAsDataURL(event.target.files[0]);
}
}
Expand Down
6 changes: 2 additions & 4 deletions app/views/account/site_settings/edit.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ fieldset.bordered
.form-group.row
.col-12.has-float-label.my-auto
= f.input :title, class: "form-control", input_html: { data: { action: "input->handle-browser-tab#setTitle" } }
= f.input :favicon, class: "form-control", input_html: { data: { action: "change->handle-browser-tab#setIcon" } }
.d-inline-flex.align-items-baseline
= f.label t(".file_select"), for: :site_setting_favicon, class: "btn btn-success me-2 mb-4"
= f.label t(".file_not_select"), data: { handle_browser_tab_target: "faviconFile" }
= f.input :favicon, class: "form-control", input_html: { data: { action: "change->handle-browser-tab#setIcon" } }

= render "browser_tab", site_setting: @site_setting

= f.submit t(".apply_button")
Expand Down

0 comments on commit bfb5741

Please sign in to comment.