diff --git a/app/css/app.css b/app/css/app.css index 452e7830..af2865e2 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -313,6 +313,13 @@ input[type="number"] { .modal { overflow-y: auto; + padding: 10px; +} +.mobile_modal { + padding: 0; +} +.modal-dialog { + margin: 0 auto; } .modal-content { border: 0; @@ -380,13 +387,6 @@ input[type="number"] { background-image: url(../img/icons/PhotoControls_1x.png); } -.modal { - padding: 10px; -} -.modal-dialog { - margin: 0 auto; -} - .text-invisible { visibility: hidden; } @@ -2620,7 +2620,7 @@ img.chat_modal_participant_photo { } .settings_modal_wrap .im_attach_input { - z-index: 1200; + z-index: 999; } .settings_modal_settings { padding: 4px 0; @@ -2932,6 +2932,7 @@ a:hover .icon-twitter { height: 40px; margin-right: 10px; overflow: hidden; + border-radius: 2px; } .contacts_modal_contact_status { diff --git a/app/css/app_mobile.css b/app/css/app_mobile.css index 930fb935..b2f68b30 100644 --- a/app/css/app_mobile.css +++ b/app/css/app_mobile.css @@ -81,7 +81,8 @@ html { left: auto; width: 195px; } -.navbar_peer_not_selected .navbar-toggle-wrap .dropdown-menu { +.navbar_peer_not_selected .navbar-toggle-wrap .dropdown-menu, +.tg_modal_head .navbar-toggle-wrap .dropdown-menu { right: 6px; } @@ -109,7 +110,8 @@ html { .is_1x .icon-search { background-image: url(../img/icons/MobileIcons_1x.png); } -.tg_page_head .navbar_peer_not_selected .navbar-search-wrap { +.tg_page_head .navbar_peer_not_selected .navbar-search-wrap, +.tg_modal_head .navbar-search-wrap { display: block; } @@ -854,9 +856,6 @@ a.im_dialog_selected .im_dialog_message_text { color: #8f8f8f; } -.im_message_fwd_from { - margin-top: 0; -} .im_grouped_fwd_start .im_message_fwd_title { display: block; color: #8a8a8a; @@ -913,13 +912,6 @@ a.im_message_fwd_author { } - - -.peer_select_modal_wrap .modal-body { - padding-left: 0; - padding-right: 0; -} - .modal.page_modal { background: #FFF; } @@ -937,10 +929,98 @@ a.im_message_fwd_author { .page_modal .modal-footer { padding-left: 0; padding-right: 0; - padding-bottom: 0; + padding-bottom: 9px; +} + +.mobile_modal_body, +.page_modal .modal-content .mobile_modal_body { + padding: 9px; } +.mobile_user_modal_photo_profile_wrap { + padding: 3px; + margin-bottom: 15px; +} +.mobile_user_modal_image_wrap { + display: block; + width: 64px; + height: 64px; + margin-right: 14px; +} +.mobile_chat_modal_image { + margin-right: 14px; + float: left; +} +.mobile_user_modal_image { + width: 64px; + height: 64px; + overflow: hidden; + border-radius: 32px; +} +.mobile_user_modal_info_wrap { + padding-top: 2px; +} +.mobile_user_modal_header { + font-size: 16px; + font-weight: bold; + margin-bottom: 7px; + margin-top: 11px +} +.mobile_user_modal_status { + font-size: 14px; + color: #999; +} +.mobile_modal_action_wrap { + border-bottom: 1px solid #e0e0e0; +} +a.mobile_modal_action, +span.mobile_modal_action { + color: #000; + display: block; + line-height: 47px; + font-size: 15px; + padding: 0 12px; + margin: 0; +} +span.mobile_modal_upload_action { + position: relative; +} +a.mobile_modal_action:hover, +a.mobile_modal_action:active { + text-decoration: none; +} +a.mobile_modal_action .icon-checkbox-outer { + float: right; + margin-top: 16px; + margin-right: 1px; +} +a.mobile_modal_action .tg_checkbox_label { + vertical-align: baseline; + line-height: inherit; +} + +.mobile_modal_section { + border-bottom: 1px solid #e0e0e0; + padding: 15px 0; +} +.mobile_modal_section:last-child { + border-bottom: 0; +} +.mobile_modal_section_header { + font-size: 12px; + margin-bottom: 3px; + margin-top: 0; + color: #999; + padding: 0 12px; +} +.mobile_modal_section_value { + font-size: 15px; + padding: 0 12px; +} +.mobile_modal_section_body { + padding: 0 12px; +} .user_modal_other_btn button { padding-right: 0; @@ -1147,5 +1227,40 @@ a.im_message_fwd_author { opacity: 1; } +.contacts_modal_search { + padding: 3px 0 12px; +} +.contacts_modal_col { + margin-right: -12px; +} +.contacts_scrollable_wrap { + padding-right: 12px; +} +.contacts_modal_col .nano > .nano-pane { + width: 6px; + right: 5px; +} +.contacts_modal_members_list a.contacts_modal_contact { + padding: 8px 0; + border-radius: 0; + border-bottom: 1px solid #e0e0e0; +} +.contacts_modal_members_list li.contacts_modal_contact_wrap { + margin: 0; +} +.contacts_modal_members_list li:last-child a { + border-bottom: 0; +} +.contacts_modal_members_list a.contacts_modal_contact:hover { + background: inherit; +} + +.mobile_modal .peer_select_modal_wrap .modal-body { + padding: 0; +} +.settings_about_section_body { + padding-right: 0; +} + } diff --git a/app/js/controllers.js b/app/js/controllers.js index 57841d85..9fbebab4 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -236,10 +236,18 @@ angular.module('myApp.controllers', []) $scope.historyState = {selectActions: false, typing: []}; $scope.openSettings = function () { + var tUrl = 'partials/settings_modal.html', + className = 'settings_modal_window page_modal'; + + if (Config.Navigator.mobile) { + tUrl = 'partials/mobile/settings_modal.html'; + className += ' mobile_modal'; + } + $modal.open({ - templateUrl: 'partials/settings_modal.html', + templateUrl: tUrl, controller: 'SettingsModalController', - windowClass: 'settings_modal_window page_modal' + windowClass: className }); } @@ -2119,6 +2127,10 @@ angular.module('myApp.controllers', []) $modalInstance.close(peerString); }); }; + + $scope.toggleSearch = function () { + $scope.$broadcast('dialogs_search_toggle'); + }; }) .controller('ChatCreateModalController', function ($scope, $modalInstance, $rootScope, MtpApiManager, AppUsersManager, AppChatsManager, ApiUpdatesManager) { diff --git a/app/js/directives.js b/app/js/directives.js index c2145868..a0e21140 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -241,7 +241,10 @@ angular.module('myApp.directives', ['myApp.filters']) dialogsColWrap = $('.im_dialogs_col_wrap')[0], scrollableWrap = $('.im_dialogs_scrollable_wrap', element)[0], headWrap = $('.tg_page_head')[0], - panelWrap = $('.im_dialogs_panel')[0], + panelWrapSelector = Config.Navigator.mobile && attrs.modal + ? '.mobile_modal_body .im_dialogs_panel' + : '.im_dialogs_panel', + panelWrap = $(panelWrapSelector)[0], footer = $('.im_page_footer')[0], hasTabs = false, moreNotified = false; @@ -300,10 +303,15 @@ angular.module('myApp.directives', ['myApp.filters']) function updateSizes () { + if (!panelWrap || !panelWrap.offsetHeight) { + panelWrap = $(panelWrapSelector)[0]; + } + if (attrs.modal) { $(element).css({ height: $($window).height() - - (Config.Navigator.mobile ? 100 : 200) + (panelWrap ? panelWrap.offsetHeight : 58) - + (Config.Navigator.mobile ? 46 : 200) }); updateScroller(); return; @@ -315,9 +323,7 @@ angular.module('myApp.directives', ['myApp.filters']) if (!footer || !footer.offsetHeight) { footer = $('.im_page_footer')[0]; } - if (!panelWrap || !panelWrap.offsetHeight) { - panelWrap = $('.im_dialogs_panel')[0]; - } + if (!dialogsColWrap || !dialogsColWrap.offsetHeight) { dialogsColWrap = $('.im_dialogs_col_wrap')[0]; } @@ -361,7 +367,7 @@ angular.module('myApp.directives', ['myApp.filters']) height: $($window).height() - (panelWrap && panelWrap.offsetHeight || 0) - (searchWrap && searchWrap.offsetHeight || 0) - - (Config.Navigator.mobile ? 100 : 200) + (Config.Navigator.mobile ? 64 : 200) }); $(contactsWrap).nanoScroller(); } @@ -1606,7 +1612,6 @@ angular.module('myApp.directives', ['myApp.filters']) }; $scope.$watch(attrs.myUserStatus, function (newUserID) { - console.log(attrs.myUserStatus, newUserID); userID = newUserID; update(); }); diff --git a/app/js/services.js b/app/js/services.js index fc67c220..afcac486 100644 --- a/app/js/services.js +++ b/app/js/services.js @@ -161,11 +161,19 @@ angular.module('myApp.services', []) var scope = $rootScope.$new(); scope.userID = userID; + var tUrl = 'partials/user_modal.html', + className = 'user_modal_window page_modal'; + + if (Config.Navigator.mobile) { + tUrl = 'partials/mobile/user_modal.html'; + className += ' mobile_modal'; + } + var modalInstance = $modal.open({ - templateUrl: 'partials/user_modal.html', + templateUrl: tUrl, controller: 'UserModalController', scope: scope, - windowClass: 'user_modal_window page_modal' + windowClass: className }); }; $rootScope.openUser = openUser; @@ -493,11 +501,19 @@ angular.module('myApp.services', []) var scope = $rootScope.$new(); scope.chatID = chatID; + var tUrl = 'partials/chat_modal.html', + className = 'chat_modal_window page_modal'; + + if (Config.Navigator.mobile) { + tUrl = 'partials/mobile/chat_modal.html'; + className += ' mobile_modal'; + } + var modalInstance = $modal.open({ - templateUrl: 'partials/chat_modal.html', + templateUrl: tUrl, controller: 'ChatModalController', - windowClass: 'chat_modal_window page_modal', - scope: scope + scope: scope, + windowClass: className }); } @@ -3632,11 +3648,19 @@ angular.module('myApp.services', []) angular.extend(scope, options); } + var tUrl = 'partials/peer_select.html', + className = 'peer_select_window page_modal'; + + if (Config.Navigator.mobile) { + tUrl = 'partials/mobile/peer_select.html'; + className += ' mobile_modal'; + } + return $modal.open({ - templateUrl: 'partials/peer_select.html', + templateUrl: tUrl, controller: 'PeerSelectController', scope: scope, - windowClass: 'peer_select_window' + windowClass: className }).result; } @@ -3659,11 +3683,19 @@ angular.module('myApp.services', []) scope.action = 'select'; } + var tUrl = 'partials/contacts_modal.html', + className = 'contacts_modal_window page_modal'; + + if (Config.Navigator.mobile) { + tUrl = 'partials/mobile/contacts_modal.html'; + className += ' mobile_modal'; + } + return $modal.open({ - templateUrl: 'partials/contacts_modal.html', + templateUrl: tUrl, controller: 'ContactsModalController', scope: scope, - windowClass: 'contacts_modal_window page_modal' + windowClass: className }).result; } diff --git a/app/partials/head.html b/app/partials/head.html index d5731a98..0de2e01f 100644 --- a/app/partials/head.html +++ b/app/partials/head.html @@ -47,9 +47,9 @@