mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
alert words: fix accidental use of a global variable.
The global in question was `event`, set to:
MouseEvent {dataTransfer: null,
toElement: button.btn btn-mini add-alert-word,
fromElement: null, y: 442, x: 763…}
in Chrome. This does seem to be the correct event.
In Chrome, this global variable existed, so the code path didn't error
out. In Firefox, the global variable didn't exist, causing adding
alert words to fail.
(imported from commit 6bd2a0315ff56a20027074d65ccaa094bd35e63f)
This commit is contained in:
@@ -22,7 +22,7 @@ $(function () {
|
||||
dataType: 'json'});
|
||||
}
|
||||
|
||||
function add_alert_word(word) {
|
||||
function add_alert_word(word, event) {
|
||||
if (word === '') {
|
||||
return;
|
||||
}
|
||||
@@ -44,7 +44,7 @@ $(function () {
|
||||
|
||||
$('#word-alerts').on('click', '.add-alert-word', function (event) {
|
||||
var word = $(event.target).siblings('input').val();
|
||||
add_alert_word(word);
|
||||
add_alert_word(word, event);
|
||||
});
|
||||
|
||||
$('#word-alerts').on('click', '.remove-alert-word', function (event) {
|
||||
|
||||
Reference in New Issue
Block a user