1
0
mirror of https://github.com/moparisthebest/mail synced 2024-12-23 15:58:49 -05:00

Use local () instead of () in certain cases for performance

This commit is contained in:
Tankred Hase 2014-04-24 15:44:54 +02:00
parent bb386299b9
commit 2eff335680
2 changed files with 7 additions and 10 deletions

View File

@ -44,7 +44,7 @@ define(function(require) {
}
// display fetched body
$scope.$apply();
$scope.$digest();
// automatically decrypt if it's the selected email
if (email === $scope.state.mailList.selected) {
@ -209,7 +209,6 @@ define(function(require) {
$timeout(function() {
// display and select first
selectFirstMessage();
$scope.$apply();
});
$scope.synchronize();
@ -455,7 +454,6 @@ define(function(require) {
scope.$watchCollection(model, function() {
$timeout(function() {
myScroll.refresh();
scope.$apply();
});
// load the visible message bodies, when the list is re-initialized and when scrolling stopped
scope.loadVisibleBodies();

View File

@ -174,7 +174,7 @@ define(function(require) {
}
$scope.checkSendStatus();
$scope.$apply();
$scope.$digest();
});
};
@ -334,10 +334,9 @@ define(function(require) {
link: function(scope, elm, attrs, ctrl) {
// view -> model
elm.on('keyup keydown', function() {
scope.$apply(function() {
// set model
ctrl.$setViewValue(elm[0].innerText);
});
scope.$digest();
});
// model -> view
@ -481,7 +480,7 @@ define(function(require) {
element.on('keydown', function(e) {
var code = e.keyCode;
scope.$apply();
scope.$digest();
if (code === 32 || code === 188 || code === 186) {
// catch space, comma, semicolon
@ -523,7 +522,7 @@ define(function(require) {
mimeType: file.type,
content: new Uint8Array(e.target.result)
});
scope.$apply();
scope.$digest();
};
reader.readAsArrayBuffer(file);
}