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:
Jessica McKellar 2013-11-06 18:42:14 -05:00
parent 24ae5998e5
commit 07959dc6d9
1 changed files with 2 additions and 2 deletions

View File

@ -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) {