Skip to content

Commit 4629c5a

Browse files
author
Natalia Momotenko
committed
Merge remote-tracking branch 'origin/MAGETWO-35520' into PR
2 parents e870b63 + bd023ff commit 4629c5a

File tree

2 files changed

+44
-22
lines changed

2 files changed

+44
-22
lines changed

app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_actions-bar.less

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525
//
2626

27-
.page-main-actions,
28-
.page-actions.fixed {
27+
.page-main-actions:not(._hidden),
28+
.page-actions._fixed {
2929
.extend__clearfix();
3030
background: @page-main-actions__background-color;
3131
border-bottom: 1px solid @page-main-actions__border-color;
@@ -35,6 +35,11 @@
3535

3636
.page-main-actions {
3737
margin: 0 0 @indent__l;
38+
&._hidden {
39+
.store-switcher {
40+
display: none;
41+
}
42+
}
3843
}
3944

4045
//
@@ -44,21 +49,23 @@
4449
.page-actions {
4550
@_page-action__indent: 1.3rem;
4651
float: right;
47-
&.fixed {
48-
left: @page-wrapper__indent-left;
49-
position: fixed;
50-
right: 0;
51-
top: 0;
52-
z-index: @page-actions__fixed__z-index;
53-
.page-actions-inner {
54-
&:before {
55-
.text-overflow-ellipsis();
56-
color: @page-title__color;
57-
content: attr(data-title);
58-
float: left;
59-
font-size: @page-title__font-size;
60-
margin-top: .3rem;
61-
max-width: 50%;
52+
.page-main-actions & {
53+
&._fixed {
54+
left: @page-wrapper__indent-left;
55+
position: fixed;
56+
right: 0;
57+
top: 0;
58+
z-index: @page-actions__fixed__z-index;
59+
.page-actions-inner {
60+
&:before {
61+
.text-overflow-ellipsis();
62+
color: @page-title__color;
63+
content: attr(data-title);
64+
float: left;
65+
font-size: @page-title__font-size;
66+
margin-top: .3rem;
67+
max-width: 50%;
68+
}
6269
}
6370
}
6471
}

lib/web/mage/backend/floating-header.js

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ define([
1414
placeholderAttrs: {
1515
'class': 'page-actions-placeholder'
1616
},
17-
fixedClass: 'fixed',
18-
title: '.page-title-wrapper .page-title'
17+
fixedClass: '_fixed',
18+
hiddenClass: '_hidden',
19+
title: '.page-title-wrapper .page-title',
20+
pageMainActions: '.page-main-actions'
1921
},
2022

2123
/**
@@ -44,7 +46,9 @@ define([
4446
_setVars: function() {
4547
this._placeholder = this.element.before($('<div/>', this.options.placeholderAttrs)).prev();
4648
this._offsetTop = this._placeholder.offset().top;
47-
this._height = this.element.outerHeight(true);
49+
this._height = this.element
50+
.parents(this.options.pageMainActions)
51+
.outerHeight();
4852
},
4953

5054
/**
@@ -65,8 +69,19 @@ define([
6569
*/
6670
_handlePageScroll: function() {
6771
var isActive = ($(window).scrollTop() > this._offsetTop);
68-
this.element
69-
[isActive ? 'addClass': 'removeClass'](this.options.fixedClass);
72+
73+
if (isActive) {
74+
this.element
75+
.addClass(this.options.fixedClass)
76+
.parents(this.options.pageMainActions)
77+
.addClass(this.options.hiddenClass);
78+
} else {
79+
this.element
80+
.removeClass(this.options.fixedClass)
81+
.parents(this.options.pageMainActions)
82+
.removeClass(this.options.hiddenClass);
83+
}
84+
7085
this._placeholder.height(isActive ? this._height: '');
7186
},
7287

0 commit comments

Comments
 (0)