mirror of
https://github.com/transmission/transmission.git
synced 2025-12-23 20:08:43 +00:00
Use id when handling hotkeys for specific dialogs
Identifying a dialog by it's header title is kinda dirty and now we use the dialogs id instead. We also check if the dialog is visible before executing the hotkey action.
This commit is contained in:
@@ -41,6 +41,11 @@ Dialog.prototype = {
|
||||
*
|
||||
*--------------------------------------------*/
|
||||
|
||||
executeCallback: function () {
|
||||
this._callback();
|
||||
dialog.hideDialog();
|
||||
},
|
||||
|
||||
hideDialog: function () {
|
||||
$('body.dialog_showing').removeClass('dialog_showing');
|
||||
this._container.hide();
|
||||
@@ -48,14 +53,16 @@ Dialog.prototype = {
|
||||
transmission.updateButtonStates();
|
||||
},
|
||||
|
||||
isVisible: function () {
|
||||
return this._container.is(':visible');
|
||||
},
|
||||
|
||||
onCancelClicked: function (event) {
|
||||
event.data.dialog.hideDialog();
|
||||
},
|
||||
|
||||
onConfirmClicked: function (event) {
|
||||
var dialog = event.data.dialog;
|
||||
dialog._callback();
|
||||
dialog.hideDialog();
|
||||
event.data.dialog.executeCallback();
|
||||
},
|
||||
|
||||
/*--------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user