modals: Remove data-dismiss usage and update cancel actions.

Replaced `data-dismiss="modal"` attributes with class/ID-based event
handling to align with Micromodal usage. Also removed an unused CSS
rule which was defined.
This commit is contained in:
Maneesh Shukla
2025-03-06 19:56:39 +05:30
committed by Tim Abbott
parent dfaecab2b8
commit d2a9b5dda5
5 changed files with 28 additions and 26 deletions

View File

@@ -1051,15 +1051,19 @@ export function initialize(): void {
open_create_stream();
});
$("#channels_overlay_container").on("click", "#stream_creation_form [data-dismiss]", (e) => {
e.preventDefault();
// we want to make sure that the click is not just a simulated
// click; this fixes an issue where hitting "Enter" would
// trigger this code path due to bootstrap magic.
if (e.clientY !== 0) {
stream_edit.open_edit_panel_empty();
}
});
$("#channels_overlay_container").on(
"click",
"#stream_creation_form .create_stream_cancel",
(e) => {
e.preventDefault();
// we want to make sure that the click is not just a simulated
// click; this fixes an issue where hitting "Enter" would
// trigger this code path due to bootstrap magic.
if (e.clientY !== 0) {
stream_edit.open_edit_panel_empty();
}
},
);
$("#channels_overlay_container").on("click", ".email-address", function (this: HTMLElement) {
selectText(this);

View File

@@ -1947,15 +1947,19 @@ export function initialize(): void {
open_create_user_group();
});
$("#groups_overlay_container").on("click", "#user_group_creation_form [data-dismiss]", (e) => {
e.preventDefault();
// we want to make sure that the click is not just a simulated
// click; this fixes an issue where hitting "Enter" would
// trigger this code path due to bootstrap magic.
if (e.clientY !== 0) {
open_right_panel_empty();
}
});
$("#groups_overlay_container").on(
"click",
"#user_group_creation_form .create_user_group_cancel",
(e) => {
e.preventDefault();
// we want to make sure that the click is not just a simulated
// click; this fixes an issue where hitting "Enter" would
// trigger this code path due to bootstrap magic.
if (e.clientY !== 0) {
open_right_panel_empty();
}
},
);
$("#groups_overlay_container").on("click", ".group-row", show_right_section);

View File

@@ -268,12 +268,6 @@ h3,
display: inline !important;
}
/* Messy implementation of buttons with text and a pencil icon in them
having spacing before the pencil icon. */
button[data-dismiss="modal"] i.fa-pencil {
margin-left: 3px;
}
.hidden-email {
font-style: italic;
}

View File

@@ -50,7 +50,7 @@
<button id="stream_creation_go_to_configure_channel_settings" class="button small sea-green rounded hide">{{t "Back to settings" }}</button>
</div>
<div class="settings-sticky-footer-right">
<button class="create_stream_cancel button small white rounded" data-dismiss="modal">{{t "Cancel" }}</button>
<button class="create_stream_cancel button small white rounded">{{t "Cancel" }}</button>
<button class="finalize_create_stream button small sea-green rounded hide" type="submit">{{t "Create" }}</button>
<button id="stream_creation_go_to_subscribers" class="button small sea-green rounded">{{t "Continue to add subscribers" }}</button>
</div>

View File

@@ -49,7 +49,7 @@
<button id="user_group_go_to_configure_settings" class="button small sea-green rounded hide">{{t "Back to settings" }}</button>
</div>
<div class="settings-sticky-footer-right">
<button class="create_user_group_cancel button small white rounded" data-dismiss="modal">{{t "Cancel" }}</button>
<button class="create_user_group_cancel button small white rounded">{{t "Cancel" }}</button>
<button class="finalize_create_user_group button small sea-green rounded hide" type="submit">{{t "Create" }}</button>
<button id="user_group_go_to_members" class="button small sea-green rounded">{{t "Continue to add members" }}</button>
</div>