/**
 * Mageplaza
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Mageplaza.com license that is
 * available through the world-wide-web at this URL:
 * https://www.mageplaza.com/LICENSE.txt
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade this extension to newer
 * version in the future.
 *
 * @category    Mageplaza
 * @package     Mageplaza_Faqs
 * @copyright   Copyright (c) Mageplaza (https://www.mageplaza.com/)
 * @license     https://www.mageplaza.com/LICENSE.txt
 */


require([
    'jquery'
// eslint-disable-next-line strict
], function ($) {
    var iconCat       = $('#category-icon-image i'),
        loaderCat     = $('#category-icon-image img'),
        iconArticle   = $('#article-icon-image i'),
        loaderArticle = $('#article-icon-image img');

    $('#category_icon').keypress(function () {
        iconCat.removeClass(iconCat.attr('class'));
        loaderCat.show();
    });
    $('#category_icon').keyup(function () {
        loaderCat.hide();
        iconCat.addClass($(this).val());
    });

    $('#article_icon').keypress(function () {
        iconArticle.removeClass(iconArticle.attr('class'));
        loaderArticle.show();
    });
    $('#article_icon').keyup(function () {
        loaderArticle.hide();
        iconArticle.addClass($(this).val());
    });
});
