mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 20:41:46 +00:00
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:
@@ -388,7 +388,7 @@ exports.set_up = function () {
|
||||
$("#active_bots_list").on("click", "button.open_edit_bot_form", function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
overlays.open_modal('edit_bot_modal');
|
||||
overlays.open_modal('#edit_bot_modal');
|
||||
const li = $(e.currentTarget).closest('li');
|
||||
const bot_id = parseInt(li.find('.bot_info').attr('data-user-id'), 10);
|
||||
const bot = bot_data.get(bot_id);
|
||||
@@ -475,13 +475,13 @@ exports.set_up = function () {
|
||||
image_version += 1;
|
||||
image.find('img').attr('src', data.avatar_url + '&v=' + image_version.toString());
|
||||
}
|
||||
overlays.close_modal('edit_bot_modal');
|
||||
overlays.close_modal('#edit_bot_modal');
|
||||
},
|
||||
error: function (xhr) {
|
||||
loading.destroy_indicator(spinner);
|
||||
edit_button.show();
|
||||
errors.text(JSON.parse(xhr.responseText).msg).show();
|
||||
overlays.close_modal('edit_bot_modal');
|
||||
overlays.close_modal('#edit_bot_modal');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user