Fix short history move bug

This commit is contained in:
Igor Zhukov 2014-01-12 02:45:21 +04:00
parent 8cf1125b78
commit 463f1d186e
2 changed files with 6 additions and 3 deletions

View File

@ -39,7 +39,7 @@
<script type="text/javascript" src="js/services.js?3"></script> <script type="text/javascript" src="js/services.js?3"></script>
<script type="text/javascript" src="js/controllers.js?2"></script> <script type="text/javascript" src="js/controllers.js?2"></script>
<script type="text/javascript" src="js/filters.js?1"></script> <script type="text/javascript" src="js/filters.js?1"></script>
<script type="text/javascript" src="js/directives.js?2"></script> <script type="text/javascript" src="js/directives.js?3"></script>
</body> </body>
</html> </html>

View File

@ -97,6 +97,7 @@ angular.module('myApp.directives', ['myApp.filters'])
function link (scope, element, attrs) { function link (scope, element, attrs) {
var historyWrap = $('.im_history_wrap')[0], var historyWrap = $('.im_history_wrap')[0],
historyEl = $('.im_history')[0],
scrollableWrap = $('.im_history_scrollable_wrap')[0], scrollableWrap = $('.im_history_scrollable_wrap')[0],
scrollable = $('.im_history_scrollable')[0], scrollable = $('.im_history_scrollable')[0],
panelWrap = $('.im_history_panel_wrap', element)[0], panelWrap = $('.im_history_panel_wrap', element)[0],
@ -182,6 +183,9 @@ angular.module('myApp.directives', ['myApp.filters'])
$(historyWrap).css({ $(historyWrap).css({
height: $($window).height() - panelWrap.offsetHeight - sendFormWrap.offsetHeight - 90 height: $($window).height() - panelWrap.offsetHeight - sendFormWrap.offsetHeight - 90
}); });
$(historyEl).css({
minHeight: $($window).height() - panelWrap.offsetHeight - sendFormWrap.offsetHeight - 90 - 44
});
if (heightOnly) return; if (heightOnly) return;
if (atBottom) { if (atBottom) {
@ -329,10 +333,9 @@ angular.module('myApp.directives', ['myApp.filters'])
}; };
function link (scope, element, attrs) { function link (scope, element, attrs) {
scope.$watch('thumb.location', function (newVal) { scope.$watch('thumb.location', function (newVal) {
if (!scope.thumb || !scope.thumb.location) { if (!scope.thumb || !scope.thumb.location) {
element.attr('src', scope.thumb.placeholder || ''); element.attr('src', scope.thumb && scope.thumb.placeholder || '');
return; return;
} }