Bug 1092953: show a modal confirm dialog when a user attempts to delete a room. r=paolo

This commit is contained in:
Mike de Boer
2014-11-28 11:45:17 +01:00
parent a0217196fb
commit 55d4d7dd98
5 changed files with 81 additions and 45 deletions

View File

@@ -617,10 +617,23 @@ loop.panel = (function(_, mozL10n) {
handleDeleteButtonClick: function(event) {
event.stopPropagation();
event.preventDefault();
// XXX We should prompt end user for confirmation; see bug 1092953.
this.props.dispatcher.dispatch(new sharedActions.DeleteRoom({
roomToken: this.props.room.roomToken
}));
navigator.mozLoop.confirm({
message: mozL10n.get("rooms_list_deleteConfirmation_label"),
okButton: null,
cancelButton: null
}, function(err, result) {
if (err) {
throw err;
}
if (!result) {
return;
}
this.props.dispatcher.dispatch(new sharedActions.DeleteRoom({
roomToken: this.props.room.roomToken
}));
}.bind(this));
},
renameRoom: function(newRoomName) {