|
|
@ -540,10 +540,14 @@ angular.module('myApp.directives', ['myApp.filters']) |
|
|
|
$(richTextarea).on('DOMNodeInserted', onPastedImageEvent); |
|
|
|
$(richTextarea).on('DOMNodeInserted', onPastedImageEvent); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$scope.$on('ui_peer_change', focusField); |
|
|
|
if (!window._mobile) { |
|
|
|
$scope.$on('ui_history_focus', focusField); |
|
|
|
$scope.$on('ui_peer_change', focusField); |
|
|
|
$scope.$on('ui_history_change', focusField); |
|
|
|
$scope.$on('ui_history_focus', focusField); |
|
|
|
|
|
|
|
$scope.$on('ui_history_change', focusField); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$scope.$on('ui_message_send', focusField); |
|
|
|
$scope.$on('ui_message_send', focusField); |
|
|
|
|
|
|
|
|
|
|
|
$scope.$on('ui_peer_draft', updateField); |
|
|
|
$scope.$on('ui_peer_draft', updateField); |
|
|
|
$scope.$on('ui_message_before_send', updateValue); |
|
|
|
$scope.$on('ui_message_before_send', updateValue); |
|
|
|
|
|
|
|
|
|
|
@ -556,7 +560,9 @@ angular.module('myApp.directives', ['myApp.filters']) |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
focusField(); |
|
|
|
if (!window._mobile) { |
|
|
|
|
|
|
|
focusField(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function focusField () { |
|
|
|
function focusField () { |
|
|
|
onContentLoaded(function () { |
|
|
|
onContentLoaded(function () { |
|
|
@ -679,6 +685,7 @@ angular.module('myApp.directives', ['myApp.filters']) |
|
|
|
if ($scope.thumb && $scope.thumb.width && $scope.thumb.height) { |
|
|
|
if ($scope.thumb && $scope.thumb.width && $scope.thumb.height) { |
|
|
|
element.attr('width', $scope.thumb.width); |
|
|
|
element.attr('width', $scope.thumb.width); |
|
|
|
element.attr('height', $scope.thumb.height); |
|
|
|
element.attr('height', $scope.thumb.height); |
|
|
|
|
|
|
|
$scope.$emit('ui_height'); |
|
|
|
} |
|
|
|
} |
|
|
|
// console.log('new loc', newLocation, arguments);
|
|
|
|
// console.log('new loc', newLocation, arguments);
|
|
|
|
var counterSaved = ++counter; |
|
|
|
var counterSaved = ++counter; |
|
|
@ -842,6 +849,7 @@ angular.module('myApp.directives', ['myApp.filters']) |
|
|
|
$scope.player.hasQuicktime = hasQt; |
|
|
|
$scope.player.hasQuicktime = hasQt; |
|
|
|
$scope.player.quicktime = false; |
|
|
|
$scope.player.quicktime = false; |
|
|
|
$scope.player.src = $sce.trustAsResourceUrl(url); |
|
|
|
$scope.player.src = $sce.trustAsResourceUrl(url); |
|
|
|
|
|
|
|
$scope.$emit('ui_height'); |
|
|
|
}, function (e) { |
|
|
|
}, function (e) { |
|
|
|
console.log('Download video failed', e, $scope.video); |
|
|
|
console.log('Download video failed', e, $scope.video); |
|
|
|
$scope.progress.enabled = false; |
|
|
|
$scope.progress.enabled = false; |
|
|
@ -857,6 +865,8 @@ angular.module('myApp.directives', ['myApp.filters']) |
|
|
|
$scope.progress.percent = Math.max(1, Math.floor(100 * progress.done / progress.total)); |
|
|
|
$scope.progress.percent = Math.max(1, Math.floor(100 * progress.done / progress.total)); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.$emit('ui_height'); |
|
|
|
|
|
|
|
|
|
|
|
$scope.$on('$destroy', function () { |
|
|
|
$scope.$on('$destroy', function () { |
|
|
|
downloadPromise.cancel(); |
|
|
|
downloadPromise.cancel(); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -1010,6 +1020,9 @@ angular.module('myApp.directives', ['myApp.filters']) |
|
|
|
.directive('myFocused', function(){ |
|
|
|
.directive('myFocused', function(){ |
|
|
|
return { |
|
|
|
return { |
|
|
|
link: function($scope, element, attrs) { |
|
|
|
link: function($scope, element, attrs) { |
|
|
|
|
|
|
|
if (window._mobile) { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
setTimeout(function () { |
|
|
|
setTimeout(function () { |
|
|
|
element[0].focus(); |
|
|
|
element[0].focus(); |
|
|
|
}, 100); |
|
|
|
}, 100); |
|
|
@ -1021,6 +1034,9 @@ angular.module('myApp.directives', ['myApp.filters']) |
|
|
|
return { |
|
|
|
return { |
|
|
|
link: function($scope, element, attrs) { |
|
|
|
link: function($scope, element, attrs) { |
|
|
|
$scope.$on(attrs.myFocusOn, function () { |
|
|
|
$scope.$on(attrs.myFocusOn, function () { |
|
|
|
|
|
|
|
if (window._mobile) { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
onContentLoaded(function () { |
|
|
|
onContentLoaded(function () { |
|
|
|
element[0].focus(); |
|
|
|
element[0].focus(); |
|
|
|
}); |
|
|
|
}); |
|
|
|