@radioactive-labs/plutonium 0.4.2 → 0.4.3
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.
- package/package.json +1 -1
- package/src/css/core.css +13 -10
- package/src/css/easymde.css +166 -720
- package/src/css/intl_tel_input.css +259 -0
- package/src/css/plutonium.css +1 -0
- package/src/css/plutonium.entry.css +6 -15
- package/src/css/slim_select.css +244 -246
- package/src/dist/css/plutonium.css +2 -2
- package/src/dist/js/plutonium.js +16 -0
- package/src/dist/js/plutonium.js.map +3 -3
- package/src/dist/js/plutonium.min.js +28 -28
- package/src/dist/js/plutonium.min.js.map +4 -4
- package/src/js/controllers/register_controllers.js +2 -0
- package/src/js/controllers/remote_modal_controller.js +24 -0
|
@@ -18,6 +18,7 @@ import AttachmentPreviewController from "./attachment_preview_controller.js"
|
|
|
18
18
|
import AttachmentPreviewContainerController from "./attachment_preview_container_controller.js"
|
|
19
19
|
import SidebarController from "./sidebar_controller.js"
|
|
20
20
|
import PasswordVisibilityController from "./password_visibility_controller.js"
|
|
21
|
+
import RemoteModalController from "./remote_modal_controller.js"
|
|
21
22
|
|
|
22
23
|
export default function (application) {
|
|
23
24
|
// Register controllers here
|
|
@@ -40,4 +41,5 @@ export default function (application) {
|
|
|
40
41
|
application.register("attachment-input", AttachmentInputController)
|
|
41
42
|
application.register("attachment-preview", AttachmentPreviewController)
|
|
42
43
|
application.register("attachment-preview-container", AttachmentPreviewContainerController)
|
|
44
|
+
application.register("remote-modal", RemoteModalController)
|
|
43
45
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Controller } from "@hotwired/stimulus";
|
|
2
|
+
|
|
3
|
+
// Connects to data-controller="remote-modal"
|
|
4
|
+
export default class extends Controller {
|
|
5
|
+
connect() {
|
|
6
|
+
// Store original scroll position
|
|
7
|
+
this.originalScrollPosition = window.scrollY;
|
|
8
|
+
|
|
9
|
+
// Show the modal
|
|
10
|
+
this.element.showModal();
|
|
11
|
+
// Add close event listener
|
|
12
|
+
this.element.addEventListener('close', this.handleClose.bind(this));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
disconnect() {
|
|
16
|
+
// Clean up event listener when controller is disconnected
|
|
17
|
+
this.element.removeEventListener('close', this.handleClose);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
handleClose() {
|
|
21
|
+
// Restore the original scroll position after dialog closes
|
|
22
|
+
window.scrollTo(0, this.originalScrollPosition);
|
|
23
|
+
}
|
|
24
|
+
}
|