HEX
Server: Apache
System: Linux webm020.cluster127.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: bohousj (181416)
PHP: 8.4.22
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/bohousj/www/wp-content/plugins/happy-elementor-addons-pro/assets/admin/js/preview.js
"use strict";

;
(function ($) {
  'use strict';

  var $window = $(window),
    $document = $(document);
  function createEditHandle($scope) {
    var $documents = $scope.find('[data-elementor-id]'),
      sectionCache = [];
    $documents.each(function (index, document) {
      var $document = $(document),
        documentID = $document.data('elementor-id'),
        $handle,
        $handleIcon,
        $handleTitle,
        $existingHandle;
      if (!documentID || sectionCache.indexOf(documentID) !== -1) {
        return;
      }
      $existingHandle = $document.find('.ha-section-handle');
      if ($existingHandle.length) {
        return;
      }
      $handle = $('<div>', {
        "class": 'elementor-document-handle ha-section-handle',
        'data-section-id': documentID
      });
      $handleIcon = $('<i>', {
        "class": 'eicon-edit'
      });
      $handleTitle = $('<div>', {
        "class": 'elementor-document-handle__title'
      }).text('Edit Section');
      $handle.append($handleIcon, $handleTitle);
      $document.prepend($handle);
      sectionCache.push(documentID);
    });
  }
  function bindClickHandler() {
    $document.on('click.onSectionHandle', '.ha-section-handle', function () {
      var $handle = $(this),
        sectionID = $handle.data('section-id');
      elementorCommon.api.internal('panel/state-loading');
      elementorCommon.api.run('editor/documents/switch', {
        id: sectionID
      })["finally"](function () {
        return elementorCommon.api.internal('panel/state-ready');
      });
    });
  }
  $window.on('elementor/frontend/init', function () {
    bindClickHandler();
    elementorFrontend.hooks.addAction('frontend/element_ready/widget', function ($scope) {
      if ($scope.hasClass('happy-addon') && $scope.find('[data-elementor-type="section"]').length) {
        createEditHandle($scope);
      }
    });
  });
})(jQuery);