pages_core 3.15.1 → 3.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/assets/builds/pages_core/admin-dist.js +1 -1
- data/app/assets/builds/pages_core/admin-dist.js.map +2 -2
- data/app/javascript/components/drag/useDragCollection.ts +8 -3
- data/app/javascript/components/drag/useDragUploader.ts +1 -1
- data/app/models/concerns/pages_core/page_model/attachments.rb +5 -0
- data/app/models/concerns/pages_core/page_model/images.rb +10 -5
- metadata +2 -2
@@ -12,10 +12,15 @@ function getPosition<T>(draggable: Drag.Draggable<T>) {
|
|
12
12
|
}
|
13
13
|
|
14
14
|
function hideDraggable<T>(
|
15
|
-
draggable: Drag.
|
16
|
-
callback: () => Drag.
|
15
|
+
draggable: Drag.Item<T> | null,
|
16
|
+
callback: () => Drag.Item<T>[]
|
17
17
|
) {
|
18
|
-
if (
|
18
|
+
if (
|
19
|
+
draggable &&
|
20
|
+
draggable !== "Files" &&
|
21
|
+
"ref" in draggable &&
|
22
|
+
draggable.ref.current
|
23
|
+
) {
|
19
24
|
const prevDisplay = draggable.ref.current.style.display;
|
20
25
|
draggable.ref.current.style.display = "none";
|
21
26
|
const result = callback();
|
@@ -42,7 +42,7 @@ function mousePosition(evt: AnyTouchEvent): Drag.Position {
|
|
42
42
|
if ("touches" in evt && evt.type == "touchmove") {
|
43
43
|
x = evt.touches[0].clientX;
|
44
44
|
y = evt.touches[0].clientY;
|
45
|
-
} else if (evt
|
45
|
+
} else if ("clientX" in evt && "clientY" in evt) {
|
46
46
|
x = evt.clientX;
|
47
47
|
y = evt.clientY;
|
48
48
|
}
|
@@ -19,11 +19,11 @@ module PagesCore
|
|
19
19
|
|
20
20
|
after_save :update_primary_image
|
21
21
|
|
22
|
-
accepts_nested_attributes_for
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
22
|
+
accepts_nested_attributes_for(
|
23
|
+
:page_images,
|
24
|
+
reject_if: proc { |a| a["image_id"].blank? },
|
25
|
+
allow_destroy: true
|
26
|
+
)
|
27
27
|
end
|
28
28
|
|
29
29
|
def image?
|
@@ -42,6 +42,11 @@ module PagesCore
|
|
42
42
|
super.in_locale(locale)
|
43
43
|
end
|
44
44
|
|
45
|
+
def page_images_attributes=(attrs)
|
46
|
+
ids = page_images.map(&:id)
|
47
|
+
super(attrs.reject { |a| a["_destroy"] && ids.exclude?(a["id"]) })
|
48
|
+
end
|
49
|
+
|
45
50
|
private
|
46
51
|
|
47
52
|
def update_primary_image
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pages_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.15.
|
4
|
+
version: 3.15.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Inge Jørgensen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|