<?php

namespace GriffinForms\Admin\App\Html\Traits;

trait UiHelpersJs
{
    private function btnSpinnerJs()
    {
        echo '
        function showBtnSpinner(btnId) {
            $(btnId).prop("disabled", true);
            $(btnId).children(".gf-btn-label").addClass("visually-hidden");
            $(btnId).children(".gf-btn-spinner").removeClass("visually-hidden");
        }

        function hideBtnSpinner(btnId) {
            $(btnId).prop("disabled", false);
            $(btnId).children(".gf-btn-label").removeClass("visually-hidden");
            $(btnId).children(".gf-btn-spinner").addClass("visually-hidden");
        }
        ';
    }
}
