HEX
Server: Apache
System: Linux sg2plzcpnl508499.prod.sin2.secureserver.net 4.18.0-553.83.1.lve.el8.x86_64 #1 SMP Wed Nov 12 10:04:12 UTC 2025 x86_64
User: s76vzjg2kvav (10209820)
PHP: 8.4.18
Disabled: NONE
Upload Files
File: /home/s76vzjg2kvav/www/admin/plugins/todo-list/custom-todo-list.js
$(function () {
    'use strict';

    var byId = function (id) { return document.getElementById(id); }

    var editableList = byId('editable');

    function removeTasks() {
        $(".js-remove").on('click', function(event) {
            event.preventDefault();
            $(this).parent('li').remove();
            console.log('clicked');
        });
    }

    $(window).on('load', function(event) {
        event.preventDefault();
        /* Act on the event */
        removeTasks();
    });

    byId('addUser').onclick = function () {
        Ply.dialog('prompt', {
            title: 'Add',
            form: { name: 'name' },
        }).done(function (ui) {
            var el = document.createElement('li');
            el.innerHTML = ui.data.name + '<i class="js-remove">X</i>';
            editableList.appendChild(el);
            removeTasks();
            // Fix for ie 11
            $('body').css('overflow-y', 'auto');
        })
    };
});