diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2016-05-20 00:00:25 +0300 |
---|---|---|
committer | Loic Blot <loic.blot@unix-experience.fr> | 2016-05-20 00:00:25 +0300 |
commit | 0ddc2a8b45c58b1f50c4db6a1599f2b4b5e97ef0 (patch) | |
tree | bdbbb037f88362f4a58ecdc1c9ec665c603328cb /js | |
parent | 64939e31d7df207cb25592d6d9f059c8c0c666fb (diff) |
Cleanup + fixes
* Fix changelog
* reset URL when deleting conversation
* create a factice contact where no contact was set as selected at loading
Diffstat (limited to 'js')
-rw-r--r-- | js/public/app.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/js/public/app.js b/js/public/app.js index 83c6b4b..87c7ab0 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -237,6 +237,7 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile' $scope.messages = []; }); $scope.selectedContact.nav = ""; + OC.Util.History.pushState(''); }); }; @@ -307,7 +308,6 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile' $scope.fetchInitialPeerList = function (jsondata) { // Use a buffer for better jQuery performance - var peerListBuf = ""; var photoPrefix = ""; var bufferedContacts = []; @@ -317,16 +317,14 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile' } $.each(jsondata['phonelist'], function(id, val) { - var fn, peerLabel, idxVal; + var peerLabel, idxVal; idxVal = id.replace(/\//g,' '); idxVal2 = idxVal.replace('/ /g',''); if (typeof jsondata['contacts'][id] == 'undefined') { - fn = ''; peerLabel = idxVal; } else { - fn = jsondata['contacts'][id]; - peerLabel = fn; + peerLabel = jsondata['contacts'][id]; } if (!inArray(peerLabel, bufferedContacts)) { $scope.addContact({'label': peerLabel, 'nav': idxVal2, 'avatar': photoPrefix + jsondata['photos'][peerLabel], 'unread' : 0}); @@ -422,6 +420,11 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile' if (pnParam != null) { var urlPhoneNumber = decodeURIComponent(pnParam); if (urlPhoneNumber != null) { + // If no contact when loading, creating a new contact from urlPhoneNumber + if ($scope.selectedContact.nav === undefined) { + $scope.selectedContact.label = urlPhoneNumber; + $scope.selectedContact.nav = urlPhoneNumber; + } $scope.fetchConversation(null); changeSelectedConversation($("a[mailbox-navigation='" + urlPhoneNumber + "']")); } |