Skip to content

Commit 3cfe0aa

Browse files
seanmarciadcollie2
authored andcommitted
wip
1 parent a5292cd commit 3cfe0aa

File tree

4 files changed

+10
-22
lines changed

4 files changed

+10
-22
lines changed

app/javascript/application.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
11
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
22
import "@hotwired/turbo-rails"
33
import "controllers"
4-
import Swal from 'sweetalert2';
5-
6-
document.addEventListener('DOMContentLoaded', () => {
7-
const Toast = Swal.mixin({
8-
toast: true,
9-
position: "top-end",
10-
showConfirmButton: false,
11-
timer: 3000,
12-
timerProgressBar: true,
13-
didOpen: (toast) => {
14-
toast.onmouseenter = Swal.stopTimer;
15-
toast.onmouseleave = Swal.resumeTimer;
16-
}
17-
});
18-
// Toast.fire({
19-
// icon: "success",
20-
// title: "Signed in successfully"
21-
// });
22-
23-
});

app/javascript/controllers/flash_controller.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export default class extends Controller {
1111
if (this.messageValue) {
1212
const Toast = Swal.mixin({
1313
toast: true,
14-
position: 'top-end',
14+
position: 'top',
15+
width: '600px',
1516
showConfirmButton: false,
1617
timer: 3000,
1718
timerProgressBar: true

config/environments/development.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
# Enable server timing.
1616
config.server_timing = true
1717

18+
config.importmap.cache_sweepers << Rails.root.join("app/javascript")
19+
config.importmap.cache_sweepers << Rails.root.join("app/assets")
20+
21+
config.cache_classes = false
22+
config.action_controller.perform_caching = false
23+
config.cache_store = :null_store
24+
1825
# Enable/disable Action Controller caching. By default Action Controller caching is disabled.
1926
# Run rails dev:cache to toggle Action Controller caching.
2027
if Rails.root.join("tmp/caching-dev.txt").exist?

config/importmap.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
pin "@hotwired/turbo-rails", to: "turbo.min.js"
55
pin "@hotwired/stimulus", to: "stimulus.min.js"
66
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js"
7-
pin_all_from "app/javascript/controllers", under: "controllers"
7+
pin_all_from "app/javascript/controllers", under: "controllers", preload: true
88
pin "sweetalert2" # @11.15.10

0 commit comments

Comments
 (0)