Browse Source

slight UX improvement

master
Jovan Gerodetti 9 years ago
parent
commit
57fa8cf6fb
  1. 2
      app/js/controllers.js
  2. 7
      app/js/directives.js
  3. 12
      app/less/mobile.less
  4. 2
      app/partials/mobile/im.html

2
app/js/controllers.js

@ -473,7 +473,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
skipped: false skipped: false
}; };
$scope.voiceRecorder = { time : '', recording : null }; $scope.voiceRecorder = { time : '', recording : null, processing : false };
$scope.openSettings = function () { $scope.openSettings = function () {
$modal.open({ $modal.open({

7
app/js/directives.js

@ -1593,17 +1593,22 @@ angular.module('myApp.directives', ['myApp.filters'])
voiceRecord.on('click', function(){ voiceRecord.on('click', function(){
if (audioRecorder) { if (audioRecorder) {
$scope.$parent.$parent.voiceRecorder.processing = true;
audioRecorder.ondataavailable = function(e){ audioRecorder.ondataavailable = function(e){
var blob = e.data; var blob = e.data;
console.log(blob); console.log(blob);
$scope.draftMessage.files = [blob]; $scope.draftMessage.files = [blob];
$scope.draftMessage.isMedia = true; $scope.draftMessage.isMedia = true;
audioRecorder = null;
$scope.$parent.$parent.voiceRecorder.processing = false;
} }
} }
}); });
voiceRecord.on('touchend', function(){ $($window).on('touchend', function(){
if (audioRecorder) { if (audioRecorder) {
audioRecorder.stop(); audioRecorder.stop();
audioStream.stop(); audioStream.stop();

12
app/less/mobile.less

@ -1439,7 +1439,7 @@ a.im_message_fwd_author {
} }
} }
.im_voice_recording { .im_voice_recording, .im_processing_recording {
background-color: rgb(23, 23, 23); background-color: rgb(23, 23, 23);
color: white; color: white;
@ -1461,6 +1461,16 @@ a.im_message_fwd_author {
} }
.im_processing_recording {
.im_recorder_indicator i {
background-color: green;
}
.im_record {
display: none;
}
}
.icon-emoji { .icon-emoji {
display: inline-block; display: inline-block;
width: 22px; width: 22px;

2
app/partials/mobile/im.html

@ -130,7 +130,7 @@
</div> </div>
</div> </div>
<div class="im_send_panel_wrap" ng-show="!historyState.actions()" ng-class="{im_voice_recording: voiceRecorder.recording}"> <div class="im_send_panel_wrap" ng-show="!historyState.actions()" ng-class="{im_voice_recording: voiceRecorder.recording, im_processing_recording: voiceRecorder.processing}">
<div class="im_send_form_wrap1"> <div class="im_send_form_wrap1">

Loading…
Cancel
Save