PluginProbe
Elementor Website Builder – more than just a page builder / 4.3.0-beta3
Elementor Website Builder – more than just a page builder v4.3.0-beta3
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
elementor / assets / js / chunks / handles-position.js

handles-position.js in Elementor Website Builder – more than just a page builder 4.3.0-beta3, at assets/js/chunks/handles-position.js

91 lines 3.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function() {
2
3 //#region \0rolldown/runtime.js
4 var __create = Object.create;
5 var __defProp = Object.defineProperty;
6 var __name = (target, value) => __defProp(target, "name", {
7 value,
8 configurable: true
9 });
10 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11 var __getOwnPropNames = Object.getOwnPropertyNames;
12 var __getProtoOf = Object.getPrototypeOf;
13 var __hasOwnProp = Object.prototype.hasOwnProperty;
14 var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
15 var __copyProps = (to, from, except, desc) => {
16 if (from && typeof from === "object" || typeof from === "function") {
17 for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
18 key = keys[i];
19 if (!__hasOwnProp.call(to, key) && key !== except) {
20 __defProp(to, key, {
21 get: ((k) => from[k]).bind(null, key),
22 enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
23 });
24 }
25 }
26 }
27 return to;
28 };
29 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
30 value: mod,
31 enumerable: true
32 }) : target, mod));
33
34 //#endregion
35
36 //#region assets/dev/js/frontend/handlers/handles-position.js
37 var require_handles_position = /* @__PURE__ */ __commonJSMin(((exports) => {
38 Object.defineProperty(exports, "__esModule", { value: true });
39 exports.default = void 0;
40 var handlesInsideClass = "e-handles-inside";
41 var handlesHeight = 100;
42 var HandlesPosition = class extends elementorModules.frontend.handlers.Base {
43 onInit() {
44 this.$element.on("mouseenter", this.setHandlesPosition.bind(this));
45 }
46 isSectionScrollSnapEnabled() {
47 return elementor.settings.page.model.attributes.scroll_snap;
48 }
49 isOverflowHidden() {
50 return "hidden" === this.$element.css("overflow");
51 }
52 isEmbeddedEditArea() {
53 const editAreaElement = this.getEditAreaElement();
54 if (!editAreaElement) return false;
55 return null !== editAreaElement.closest(".elementor-embedded-editor");
56 }
57 getEditAreaElement() {
58 const $closestEditArea = this.$element.closest(".elementor-edit-area-active");
59 if ($closestEditArea.length) return $closestEditArea[0];
60 const document = elementor.documents.getCurrent();
61 const $editArea = document === null || document === void 0 ? void 0 : document.$element;
62 if ($editArea === null || $editArea === void 0 ? void 0 : $editArea.length) return $editArea[0];
63 return this.$element.closest(".elementor-edit-area")[0];
64 }
65 getEditAreaOffset() {
66 const editAreaElement = this.getEditAreaElement();
67 if (!editAreaElement) return Number.POSITIVE_INFINITY;
68 return this.$element[0].getBoundingClientRect().top - editAreaElement.getBoundingClientRect().top;
69 }
70 setHandlesPosition() {
71 const document = elementor.documents.getCurrent();
72 if (!(document === null || document === void 0 ? void 0 : document.container.isEditable())) return;
73 if (this.isSectionScrollSnapEnabled()) {
74 this.$element.addClass(handlesInsideClass);
75 return;
76 }
77 if (this.$element[0].getBoundingClientRect().top < handlesHeight || this.isOverflowHidden() || this.isEmbeddedEditArea() && this.getEditAreaOffset() < handlesHeight) this.$element.addClass(handlesInsideClass);
78 else this.$element.removeClass(handlesInsideClass);
79 }
80 };
81 exports.default = HandlesPosition;
82 }));
83
84 //#endregion
85 //#region \0elementor-chunk-entry
86 var import_handles_position = /* @__PURE__ */ __toESM(require_handles_position());
87 (window.__elementorChunks = window.__elementorChunks || {})["handles-position"] = import_handles_position;
88
89 //#endregion
90 })();
91 //# sourceMappingURL=handles-position.js.map