Skip to content
Snippets Groups Projects
Select Git revision
  • 9b15d9e3be3952c86597008e3f622f22996dda9a
  • master default
  • renovate/opencsv.version
  • renovate/org.springframework.boot-spring-boot-starter-parent-3.x
  • renovate/junit-jupiter-engine.version
  • renovate/selenium.version
  • renovate/testcontainer.version
  • demo
  • v1_8_1
  • v2.18.1
  • v2.18.0
  • v2.17.2
  • v2.17.1
  • v2.17.0
  • v2.16.1
  • v2.16.0
  • v2.15.1
  • v2.15.0
  • v2.14.0
  • v2.13.0
  • v2.12.0
  • v2.11.0
  • v2.10.0
  • v2.9.2
  • v2.9.1
  • v2.9.0
  • v2.8.0
  • testPipeline2
  • v2.7.0
29 results

accounts.js

Blame
  • transactions.js 15.80 KiB
    $(document).ready(function()
    {
        // open filter modal if corresponding anchor is in url (originating from hotkeys.js)
        if(window.location.href.endsWith('#modalFilter'))
        {
            $('#modalFilter').modal('open');
        }
    
        if($("#transaction-name").length)
        {
            let elements = document.querySelectorAll('#transaction-name');
            let autoCompleteInstances = M.Autocomplete.init(elements, {
                data: transactionNameSuggestions,
            });
    
            // prevent tab traversal for dropdown (otherwise "tab" needs to be hit twice to jump from name input to amount input)
            autoCompleteInstances[0].dropdown.dropdownEl.tabIndex = -1;
    
            document.getElementById('transaction-name').focus();
        }
    
        if($("#transaction-description").length)
        {
            $("#transaction-description").characterCounter();
        }
    
        if($(".datepicker-simple".length) && $("#transaction-repeating-end-date-input").length)
        {
            let pickerEndDate = document.getElementById('transaction-repeating-end-date-input');
    
            // select corresponding radio button
            let endDate = document.getElementById("repeating-end-date");
    
            pickerEndDate.addEventListener('input', function()
            {
                endDate.checked = true;
            });
    
            pickerEndDate.addEventListener('focus', function()
            {
                endDate.checked = true;
            });
        }
    
        if($(".datepicker").length)
        {
            let pickerStartDate = M.Datepicker.init(document.getElementById('transaction-datepicker'), {
                yearRange: 25,
                firstDay: 1,
                showClearBtn: false,
                setDefaultDate: true,
                defaultDate: startDate,
    
                i18n: {
                    // Strings and translations
                    months: monthNames,
                    monthsShort: monthNamesShort,
                    weekdays: weekDays,
                    weekdaysShort: weekDaysShort,
                    weekdaysAbbrev: weekDaysLetters,
    
                    // Buttons
                    cancel: buttonCancel,
                    done: buttonClose,
    
                    // Accessibility labels
                    labelMonthNext: '>',
                    labelMonthPrev: '<'
                },