diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index b63e57312..dec3c7c7d 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -52,7 +52,7 @@ define([ Common.Views.Header = Backbone.View.extend(_.extend(function(){ var storeUsers, appConfig; - var $userList, $panelUsers, $btnUsers, $panelShare, $btnShare; + var $userList, $panelUsers, $btnUsers, $panelShare, $btnShare, $btnUserName; var _readonlyRights = false; var templateUserItem = @@ -111,9 +111,12 @@ define([ '
' + '' + '
' + - '
' + + // '
' + + '' + '' + '
' + '' + @@ -136,9 +139,12 @@ define([ '' + '' + '
' + - '
' + + // '
' + + '' + '' + '
' + ''; @@ -530,12 +536,21 @@ define([ } if (!config.isEdit || config.customization && !!config.customization.compactHeader) { - if (config.user.guest && config.canRenameAnonymous) - me.btnUserName = createTitleButton('toolbar__icon icon--inverse btn-user', $html.findById('.slot-btn-user-name'), undefined, 'bottom', 'big' ); - else { + if (config.user.guest && config.canRenameAnonymous) { + me.btnUserName = new Common.UI.Button({ + el: $html.findById('.slot-btn-user-name'), + cls: 'btn-header', + dataHint:'0', + dataHintDirection: 'bottom', + dataHintOffset: 'big', + visible: true + }); + me.btnUserName.cmpEl.removeClass('hidden'); + } else { me.elUserName = $html.find('.btn-current-user'); me.elUserName.removeClass('hidden'); } + $btnUserName = $html.find('.color-user-name'); me.setUserName(me.options.userName); } @@ -557,12 +572,22 @@ define([ me.labelDocName.val( me.documentCaption ); me.options.wopi && me.labelDocName.attr('maxlength', me.options.wopi.FileNameMaxLength); - if (config.user.guest && config.canRenameAnonymous) - me.btnUserName = createTitleButton('toolbar__icon icon--inverse btn-user', $html.findById('.slot-btn-user-name'), undefined, 'bottom', 'big' ); + if (config.user.guest && config.canRenameAnonymous) { + me.btnUserName = new Common.UI.Button({ + el: $html.findById('.slot-btn-user-name'), + cls: 'btn-header', + dataHint:'0', + dataHintDirection: 'bottom', + dataHintOffset: 'big', + visible: true + }); + me.btnUserName.cmpEl.removeClass('hidden'); + } else { me.elUserName = $html.find('.btn-current-user'); me.elUserName.removeClass('hidden'); } + $btnUserName = $html.find('.color-user-name'); me.setUserName(me.options.userName); if ( config.canPrint && config.isEdit ) { @@ -742,7 +767,7 @@ define([ html: true }); } - + $btnUserName && $btnUserName.text(this.getInitials(name)); return this; }, @@ -792,6 +817,18 @@ define([ } }, + getInitials: function(name) { + var fio = name.split(' '); + var initials = fio[0].substring(0, 1).toUpperCase(); + for (var i = fio.length-1; i>0; i--) { + if (fio[i][0]!=='(' && fio[i][0]!==')') { + initials += fio[i].substring(0, 1).toUpperCase(); + break; + } + } + return initials; + }, + textBack: 'Go to Documents', txtRename: 'Rename', txtAccessRights: 'Change access rights', diff --git a/apps/common/main/resources/less/colors-table-classic.less b/apps/common/main/resources/less/colors-table-classic.less index 6463ae64d..88570b4ed 100644 --- a/apps/common/main/resources/less/colors-table-classic.less +++ b/apps/common/main/resources/less/colors-table-classic.less @@ -55,7 +55,7 @@ --icon-normal: #444; --icon-normal-pressed: #fff; --icon-inverse: #444; - --icon-toolbar-header: fade(#fff, 80%); + --icon-toolbar-header: #fff; --icon-notification-badge: #000; --icon-contrast-popover: #fff; --icon-success: #5b9f27; diff --git a/apps/common/main/resources/less/colors-table-dark.less b/apps/common/main/resources/less/colors-table-dark.less index 9dc4c765b..b05024c0b 100644 --- a/apps/common/main/resources/less/colors-table-dark.less +++ b/apps/common/main/resources/less/colors-table-dark.less @@ -56,7 +56,7 @@ --icon-normal: fade(#fff, 80%); --icon-normal-pressed: fade(#fff, 80%); --icon-inverse: #444; - --icon-toolbar-header: fade(#fff, 80%); + --icon-toolbar-header: #fff; --icon-notification-badge: #000; --icon-contrast-popover: #fff; --icon-success: #090; diff --git a/apps/common/main/resources/less/colors-table-ie-fix.less b/apps/common/main/resources/less/colors-table-ie-fix.less index d524f52e1..e03a66ada 100644 --- a/apps/common/main/resources/less/colors-table-ie-fix.less +++ b/apps/common/main/resources/less/colors-table-ie-fix.less @@ -51,7 +51,7 @@ @icon-normal-ie: #444; @icon-normal-pressed-ie: #fff; @icon-inverse-ie: #444; -@icon-toolbar-header-ie: fade(#fff, 80%); +@icon-toolbar-header-ie: #fff; @icon-notification-badge-ie: #000; @icon-contrast-popover-ie: #fff; @icon-success-ie: #5b9f27; diff --git a/apps/common/main/resources/less/header.less b/apps/common/main/resources/less/header.less index 149c00021..f0b5150f2 100644 --- a/apps/common/main/resources/less/header.less +++ b/apps/common/main/resources/less/header.less @@ -273,45 +273,38 @@ align-items: center; height: 100%; width: 40px; - padding: 0 10px; + padding: 1px 3px; - .icon { - width: 20px; - height: 20px; - display: inline-block; - background-repeat: no-repeat; - padding: 0; - - &.icon--inverse { - background-position-x: -20px; - } - } - - svg.icon { - vertical-align: middle; - - @media - only screen and (-webkit-min-device-pixel-ratio: 1.5), - only screen and (min-resolution: 1.5dppx), - only screen and (min-resolution: 144dpi) { - width:calc(~"28px/1.5"); - height:calc(~"28px/1.5"); - } - } - - &:not(:disabled) .icon { + &:not(:disabled) .color-user-name { opacity: @header-component-normal-icon-opacity; } - &:active, &.active .icon { + &:active, &.active .color-user-name { opacity: @header-component-active-icon-opacity; } - &:hover:not(:disabled) .icon { + &:hover:not(:disabled) .color-user-name { opacity: @header-component-hover-icon-opacity; } } +.btn-current-user, .btn-header { + .color-user-name { + width: 20px; + height: 20px; + border-radius: 20px; + background-color: @icon-toolbar-header-ie; + background-color: @icon-toolbar-header; + color: @header-background-color-ie; + color: @header-background-color; + font-size: 10px; + line-height: 20px; + overflow: hidden; + margin: 0 6px; + text-align: center; + } +} + .cousers-menu { position: fixed; top: @height-tabs - 8px; diff --git a/apps/common/main/resources/less/toolbar.less b/apps/common/main/resources/less/toolbar.less index 79e8a9d56..642a5faa9 100644 --- a/apps/common/main/resources/less/toolbar.less +++ b/apps/common/main/resources/less/toolbar.less @@ -519,13 +519,11 @@ } .btn-current-user { - .icon--inverse { - background-position-x: 0; - } - - svg.icon { - fill: @icon-toolbar-header-ie; - fill: @icon-toolbar-header; + .color-user-name { + background-color: @text-normal-ie; + background-color: @text-normal; + color: @text-inverse-ie; + color: @text-inverse; } }