Skip to content
Snippets Groups Projects
Commit 6504742a authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] direct URL to compose a new message #544

parent 88044a9f
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ angular.module('cesium.es.message.controllers', ['cesium.es.services']) ...@@ -21,7 +21,7 @@ angular.module('cesium.es.message.controllers', ['cesium.es.services'])
.state('app.user_new_message', { .state('app.user_new_message', {
cache: false, cache: false,
url: "/user/message/new?pubkey&uid", url: "/user/message/new?pubkey&uid&title&content",
views: { views: {
'menuContent': { 'menuContent': {
templateUrl: "plugins/es/templates/message/compose.html", templateUrl: "plugins/es/templates/message/compose.html",
...@@ -241,16 +241,17 @@ function ESMessageListController($scope, $state, $translate, $ionicHistory, $ion ...@@ -241,16 +241,17 @@ function ESMessageListController($scope, $state, $translate, $ionicHistory, $ion
} }
function ESMessageComposeController($scope, $controller, UIUtils, parameters) { function ESMessageComposeController($scope, $controller, UIUtils) {
'ngInject'; 'ngInject';
// Initialize the super class and extend it. // Initialize the super class and extend it.
angular.extend(this, $controller('ESMessageComposeModalCtrl', {$scope: $scope})); angular.extend(this, $controller('ESMessageComposeModalCtrl', {$scope: $scope, parameters: {}}));
$scope.$on('$ionicView.enter', function(e, state) { $scope.$on('$ionicView.enter', function(e, state) {
if (!!state.stateParams && !!state.stateParams.pubkey) { if (state.stateParams) {
if (state.stateParams.pubkey) {
$scope.formData.destPub = state.stateParams.pubkey; $scope.formData.destPub = state.stateParams.pubkey;
if (!!$state.stateParams.uid) { if (state.stateParams.uid) {
$scope.destUid = state.stateParams.uid; $scope.destUid = state.stateParams.uid;
$scope.destPub = ''; $scope.destPub = '';
} }
...@@ -260,6 +261,15 @@ function ESMessageComposeController($scope, $controller, UIUtils, parameters) { ...@@ -260,6 +261,15 @@ function ESMessageComposeController($scope, $controller, UIUtils, parameters) {
} }
} }
if (state.stateParams.title) {
$scope.formData.title = state.stateParams.title;
}
if (state.stateParams.content) {
$scope.formData.content = state.stateParams.content;
}
}
$scope.loadWallet({minData: true}) $scope.loadWallet({minData: true})
.then(function() { .then(function() {
UIUtils.loading.hide(); UIUtils.loading.hide();
...@@ -279,7 +289,7 @@ function ESMessageComposeController($scope, $controller, UIUtils, parameters) { ...@@ -279,7 +289,7 @@ function ESMessageComposeController($scope, $controller, UIUtils, parameters) {
$scope.form = form; $scope.form = form;
}; };
$scope.clodeModal = function() { $scope.closeModal = function() {
$scope.showHome(); $scope.showHome();
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment