Browse Source

Increased photo thumbs

master
Igor Zhukov 11 years ago
parent
commit
d6fda87a0d
  1. 2
      app/index.html
  2. 11
      app/js/services.js

2
app/index.html

@ -52,7 +52,7 @@
<script type="text/javascript" src="js/util.js"></script> <script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript" src="js/app.js?6"></script> <script type="text/javascript" src="js/app.js?6"></script>
<script type="text/javascript" src="js/services.js?9"></script> <script type="text/javascript" src="js/services.js?10"></script>
<script type="text/javascript" src="js/controllers.js?14"></script> <script type="text/javascript" src="js/controllers.js?14"></script>
<script type="text/javascript" src="js/filters.js?3"></script> <script type="text/javascript" src="js/filters.js?3"></script>
<script type="text/javascript" src="js/directives.js?9"></script> <script type="text/javascript" src="js/directives.js?9"></script>

11
app/js/services.js

@ -1171,13 +1171,15 @@ angular.module('myApp.services', [])
} }
}); });
console.log('choosing', photo, width, height, bestPhotoSize);
return bestPhotoSize; return bestPhotoSize;
} }
function wrapForHistory (photoID) { function wrapForHistory (photoID) {
var photo = angular.copy(photos[photoID]) || {_: 'photoEmpty'}, var photo = angular.copy(photos[photoID]) || {_: 'photoEmpty'},
width = 100, width = 260,
height = 100, height = 260,
thumbPhotoSize = choosePhotoSize(photo, width, height), thumbPhotoSize = choosePhotoSize(photo, width, height),
thumb = { thumb = {
placeholder: 'img/placeholders/PhotoThumbConversation.gif', placeholder: 'img/placeholders/PhotoThumbConversation.gif',
@ -1185,7 +1187,7 @@ angular.module('myApp.services', [])
height: height height: height
}; };
// console.log('chosen photo size', photoID, thumbPhotoSize); // console.log('chosen photo size', photoID, thumbPhotoSize);
if (thumbPhotoSize && thumbPhotoSize._ != 'photoSizeEmpty') { if (thumbPhotoSize && thumbPhotoSize._ != 'photoSizeEmpty') {
if (thumbPhotoSize.w > thumbPhotoSize.h) { if (thumbPhotoSize.w > thumbPhotoSize.h) {
thumb.height = parseInt(thumbPhotoSize.h * width / thumbPhotoSize.w); thumb.height = parseInt(thumbPhotoSize.h * width / thumbPhotoSize.w);
@ -1195,6 +1197,9 @@ angular.module('myApp.services', [])
thumb.location = thumbPhotoSize.location; thumb.location = thumbPhotoSize.location;
thumb.size = thumbPhotoSize.size; thumb.size = thumbPhotoSize.size;
} else {
thumb.width = 100;
thumb.height = 100;
} }
photo.thumb = thumb; photo.thumb = thumb;

Loading…
Cancel
Save