From 6ea0dd053c61aff72ef3018467e8c755e4951453 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Mon, 24 Mar 2014 20:50:43 +0400 Subject: [PATCH] Fixed scroll bug, added search to peer select modal --- app/css/app.css | 7 +++---- app/js/controllers.js | 8 +++++--- app/js/directives.js | 3 ++- app/partials/peer_select.html | 24 ++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/app/css/app.css b/app/css/app.css index 4eece49b..219e91ca 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -524,10 +524,12 @@ input[type="number"]::-webkit-inner-spin-button { .im_dialogs_panel { padding: 14px 12px; position: relative; +} + .im_dialogs_search { + position: relative; } .im_page_split .im_dialogs_search { margin-right: 48px; - position: relative; } .im_dialogs_search_field { font-size: 12px; @@ -853,9 +855,6 @@ a.im_dialog:hover .im_dialog_date { font-size: 1.5em; } -.im_history_to_bottom { - position: relative; -} .im_history_to_bottom .im_history_scrollable { position: absolute; bottom: 0; diff --git a/app/js/controllers.js b/app/js/controllers.js index aaed4663..64201f45 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -396,7 +396,7 @@ angular.module('myApp.controllers', []) jump = 0; function applyDialogSelect (newPeer) { - selectedCancel(); + selectedCancel(true); newPeer = newPeer || $scope.curDialog.peer || ''; peerID = AppPeersManager.getPeerID(newPeer); @@ -542,11 +542,13 @@ angular.module('myApp.controllers', []) } } - function selectedCancel () { + function selectedCancel (noBroadcast) { $scope.selectedMsgs = {}; $scope.selectedCount = 0; $scope.selectActions = false; - $scope.$broadcast('ui_panel_update'); + if (!noBroadcast) { + $scope.$broadcast('ui_panel_update'); + } } function selectedFlush () { diff --git a/app/js/directives.js b/app/js/directives.js index 9d9fa903..029b07c4 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -271,6 +271,7 @@ angular.module('myApp.directives', ['myApp.filters']) ch = scrollableWrap.clientHeight; $(scrollableWrap).addClass('im_history_to_bottom'); + scrollableWrap.scrollHeight; // Some strange Chrome bug workaround $(scrollable).css({bottom: -(sh - st - ch)}); onContentLoaded(function () { @@ -340,7 +341,7 @@ angular.module('myApp.directives', ['myApp.filters']) updateBottomizer(); - if (heightOnly == true) return; + if (heightOnly === true) return; if (atBottom) { onContentLoaded(function () { scrollableWrap.scrollTop = scrollableWrap.scrollHeight; diff --git a/app/partials/peer_select.html b/app/partials/peer_select.html index 9f2a630c..3a9f1f48 100644 --- a/app/partials/peer_select.html +++ b/app/partials/peer_select.html @@ -20,6 +20,30 @@ +
+
Contacts
+ +