modals: Use selectors for open_modal/close_modal.

When reading the calling code, it's helpful to know
that we're really just passing in a selector.  The
calls to open_modal/close_modal are nicer now to
reconcile with surrounding code, and you don't have
to guess whether the parameter is some kind of
"key" value--it really just refers directly to a DOM
element.

There is nothing user-visible about this change, but
the blueslip info messages now include the hash:

    open modal: open #change_email_modal
This commit is contained in:
Steve Howell
2020-05-09 13:45:54 +00:00
committed by Tim Abbott
parent d3aded2ae7
commit 2272c5e6eb
8 changed files with 47 additions and 40 deletions

View File

@@ -320,7 +320,7 @@ function open_user_info_form_modal(person) {
const user_info_form_modal = $(html);
const modal_container = $('#user-info-form-modal-container');
modal_container.empty().append(user_info_form_modal);
overlays.open_modal('user-info-form-modal');
overlays.open_modal('#user-info-form-modal');
if (person.is_bot) {
// Dynamically add the owner select control in order to
@@ -499,7 +499,7 @@ exports.on_load_success = function (realm_people_data) {
}
settings_ui.do_settings_change(channel.patch, url, data, admin_status);
overlays.close_modal('user-info-form-modal');
overlays.close_modal('#user-info-form-modal');
});
});