Skip to content

Commit

Permalink
fix: Ensure import is used rater than require.
Browse files Browse the repository at this point in the history
Also moving the default config into the `recurring_select_dialog.js.erb`
file.
  • Loading branch information
davegudge committed Aug 27, 2024
1 parent f4f2cb6 commit cce22de
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
3 changes: 1 addition & 2 deletions app/assets/javascripts/recurring_select.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//= require recurring_select_dialog
//= require_self
import './recurring_select_dialog.js.erb';

document.addEventListener("DOMContentLoaded", () => {
document.addEventListener("focusin", (e) => {
Expand Down
35 changes: 32 additions & 3 deletions app/assets/javascripts/recurring_select_dialog.js.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//= require utils
//= require defaults
import utils from './utils';

class RecurringSelectDialog {
constructor(recurring_selector) {
Expand Down Expand Up @@ -442,6 +441,36 @@ class RecurringSelectDialog {
}
}

RecurringSelectDialog.config = defaultConfig
RecurringSelectDialog.config = {
options: {
monthly: {
show_week: [true, true, true, true, false, false]
}
},
texts: {
locale_iso_code: "en",
repeat: "Repeat",
last_day: "Last Day",
frequency: "Frequency",
daily: "Daily",
weekly: "Weekly",
monthly: "Monthly",
yearly: "Yearly",
every: "Every",
days: "day(s)",
weeks_on: "week(s) on",
months: "month(s)",
years: "year(s)",
day_of_month: "Day of month",
day_of_week: "Day of week",
cancel: "Cancel",
ok: "OK",
summary: "Summary",
first_day_of_week: 0,
days_first_letter: ["S", "M", "T", "W", "T", "F", "S" ],
order: ["1st", "2nd", "3rd", "4th", "5th", "Last"],
show_week: [true, true, true, true, false, false]
}
}

window.RecurringSelectDialog = RecurringSelectDialog

0 comments on commit cce22de

Please sign in to comment.