mirror of https://github.com/zulip/zulip.git
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:
parent
24ae5998e5
commit
07959dc6d9
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue