mirror of https://github.com/BTCPrivate/copay.git
add better handling of native menu actions, add handlers for backup
This commit is contained in:
parent
20c7d7fe62
commit
6143dd4066
33
js/shell.js
33
js/shell.js
|
@ -14,7 +14,9 @@
|
|||
if (typeof module !== 'undefined') module = { exports: null };
|
||||
|
||||
// are we running in copay shell?
|
||||
if (window.process && process.type === 'renderer') initCopayShellBindings();
|
||||
if (window.process && process.type === 'renderer') {
|
||||
window.cshell = initCopayShellBindings();
|
||||
}
|
||||
|
||||
function controller(name) {
|
||||
return angular.element(
|
||||
|
@ -29,8 +31,11 @@
|
|||
var ipc = require('ipc');
|
||||
|
||||
ipc.on('address:create', function(data) {
|
||||
var ctrl = controller('AddressesController');
|
||||
if (ctrl) {
|
||||
location.href = '#/addresses';
|
||||
controller('AddressesController').newAddr();
|
||||
ctrl.newAddr();
|
||||
}
|
||||
});
|
||||
|
||||
ipc.on('transactions:send', function(data) {
|
||||
|
@ -38,23 +43,39 @@
|
|||
});
|
||||
|
||||
ipc.on('transactions:all', function(data) {
|
||||
var ctrl = controller('TransactionsController');
|
||||
if (ctrl) {
|
||||
location.href = '#/transactions';
|
||||
controller('TransactionsController').show();
|
||||
ctrl.show();
|
||||
}
|
||||
});
|
||||
|
||||
ipc.on('transactions:pending', function(data) {
|
||||
var ctrl = controller('TransactionsController');
|
||||
if (ctrl) {
|
||||
location.href = '#/transactions';
|
||||
controller('TransactionsController').show(true);
|
||||
ctrl.show(true);
|
||||
}
|
||||
});
|
||||
|
||||
ipc.on('backup:download', function(data) {
|
||||
|
||||
var ctrl = controller('BackupController');
|
||||
if (ctrl) {
|
||||
location.href = '#/backup';
|
||||
ctrl.download();
|
||||
}
|
||||
});
|
||||
|
||||
ipc.on('backup:email', function(data) {
|
||||
|
||||
var ctrl = controller('BackupController');
|
||||
if (ctrl) {
|
||||
location.href = '#/backup';
|
||||
ctrl.email();
|
||||
}
|
||||
});
|
||||
|
||||
return ipc;
|
||||
|
||||
};
|
||||
|
||||
})();
|
||||
|
|
Loading…
Reference in New Issue