# king-addons/51.1.49/includes/widgets/Phone_Call_Button/script.js

King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder, version 51.1.49. 39 lines.

- Page: https://pluginprobe.com/plugins/king-addons/51.1.49/code/includes/widgets/Phone_Call_Button/script.js
- Raw: https://pluginprobe.com/plugins/king-addons/51.1.49/raw/includes/widgets/Phone_Call_Button/script.js
- Modified: 2026-01-06T16:52:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/king-addons/51.1.49/code/includes/widgets/Phone_Call_Button/script.js#L10-L20`.

```javascript
"use strict";

(function ($) {
    const shouldShowForDevice = (device) => {
        if (device === "all") return true;
        const isMobile = window.matchMedia("(max-width: 767px)").matches;
        if (device === "mobile") return isMobile;
        if (device === "desktop") return !isMobile;
        return true;
    };

    const initPhoneCallButton = ($scope) => {
        const $btn = $scope.find(".king-addons-phone-call__button");
        if (!$btn.length) return;

        const device = $btn.data("device") || "all";
        if (!shouldShowForDevice(device)) {
            $btn.hide();
            return;
        }
    };

    $(window).on("elementor/frontend/init", function () {
        elementorFrontend.hooks.addAction(
            "frontend/element_ready/king-addons-phone-call-button.default",
            function ($scope) {
                initPhoneCallButton($scope);
            }
        );
    });
})(jQuery);








```
