fix dialogs.delete: Show file name in delete dialog

This commit is contained in:
Mahdi Dibaiee 2015-09-04 02:59:50 +04:30
parent ffb7c68510
commit 2ed94718d6
2 changed files with 10 additions and 2 deletions

View File

@ -23379,8 +23379,12 @@ var entryMenu = {
}, { }, {
name: 'Delete', name: 'Delete',
action: function action() { action: function action() {
var files = _store2['default'].getState().get('files');
var active = _store2['default'].getState().get('activeFile');
var name = files[active].name;
var MSG = 'Are you sure you want to remove ' + name + '?';
_store2['default'].dispatch((0, _actionsMenu.hideAll)()); _store2['default'].dispatch((0, _actionsMenu.hideAll)());
_store2['default'].dispatch((0, _actionsDialog.show)('deleteDialog')); _store2['default'].dispatch((0, _actionsDialog.show)('deleteDialog', { description: MSG }));
} }
}] }]
}; };

View File

@ -14,8 +14,12 @@ const entryMenu = {
{ {
name: 'Delete', name: 'Delete',
action() { action() {
let files = store.getState().get('files');
let active = store.getState().get('activeFile');
const name = files[active].name;
const MSG = `Are you sure you want to remove ${name}?`;
store.dispatch(hideAll()); store.dispatch(hideAll());
store.dispatch(show('deleteDialog')) store.dispatch(show('deleteDialog', {description: MSG}));
} }
} }
] ]