Fix bot edit cancel button updating name anyway.

Apparently, the bot cancel button was incorrectly tagged with
"submit", and thus ended up saving the changes anyway!

Fixes #3412.
This commit is contained in:
Raghav Jajodia
2017-01-22 00:49:20 +05:30
committed by Tim Abbott
parent 9088c46e4c
commit dd4ea5e56e
2 changed files with 2 additions and 1 deletions

View File

@@ -682,6 +682,7 @@ function _setup_page() {
}
reset_edit_bot.click(function (event) {
form.find(".edit_bot_name").val(old_full_name);
show_row_again();
$(this).off(event);
});

View File

@@ -65,7 +65,7 @@
<div class="control-group">
<div class="controls">
<input type="submit" class="btn btn-primary edit_bot_button" value="{{t 'Save' }}" />
<button type="submit" class="btn btn-default reset_edit_bot">Cancel</button>
<button type="button" class="btn btn-default reset_edit_bot">Cancel</button>
</div>
<div class="edit_bot_spinner"></div>
</div>