mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
modals: Implement new modal methods.
This commit is contained in:
@@ -160,10 +160,6 @@ exports.is_editing_stream_name = function (e) {
|
||||
return $(e.target).is(".editable-section");
|
||||
};
|
||||
|
||||
exports.is_modal_open = function () {
|
||||
return $(".modal").hasClass("in");
|
||||
};
|
||||
|
||||
// Returns true if we handled it, false if the browser should.
|
||||
exports.process_escape_key = function (e) {
|
||||
var row;
|
||||
@@ -172,8 +168,8 @@ exports.process_escape_key = function (e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (exports.is_modal_open()) {
|
||||
$(".modal").modal("hide").attr("aria-hidden", false);
|
||||
if (overlays.is_modal_open()) {
|
||||
overlays.close_active_modal();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ exports.set_up = function () {
|
||||
$('#change_email_button').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
$('#change_email_modal').modal('hide');
|
||||
overlays.close_modal('change_email_modal');
|
||||
|
||||
var data = {};
|
||||
data.email = $('.email_change_container').find("input[name='email']").val();
|
||||
@@ -173,7 +173,7 @@ exports.set_up = function () {
|
||||
$('#change_email').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
$('#change_email_modal').modal('show');
|
||||
overlays.open_modal('change_email_modal');
|
||||
var email = $('#email_value').text().trim();
|
||||
$('.email_change_container').find("input[name='email']").val(email);
|
||||
});
|
||||
|
||||
@@ -9,15 +9,13 @@ exports.set_up = function () {
|
||||
$("#emojiset_select").val(page_params.emojiset);
|
||||
|
||||
$("#default_language_modal [data-dismiss]").click(function () {
|
||||
$('#default_language_modal').attr('aria-hidden', true);
|
||||
$("#default_language_modal").fadeOut(300);
|
||||
overlays.close_modal('default_language_modal');
|
||||
});
|
||||
|
||||
$("#default_language_modal .language").click(function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
$('#default_language_modal').show().attr('aria-hidden', true);
|
||||
$('#default_language_modal').fadeOut(300);
|
||||
overlays.close_modal('default_language_modal');
|
||||
|
||||
var data = {};
|
||||
var $link = $(e.target).closest("a[data-code]");
|
||||
@@ -46,7 +44,7 @@ exports.set_up = function () {
|
||||
$('#default_language').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
$('#default_language_modal').show().attr('aria-hidden', false);
|
||||
overlays.open_modal('default_language_modal');
|
||||
});
|
||||
|
||||
$("#high_contrast_mode").change(function () {
|
||||
|
||||
Reference in New Issue
Block a user