[DE] Fix max width for divide of document formats in Download As panel

This commit is contained in:
JuliaSvinareva 2022-11-16 01:05:58 +03:00
parent 088a3c8e11
commit ad3de112b8
2 changed files with 49 additions and 24 deletions

View file

@ -95,6 +95,16 @@ define([
this.menu = options.menu;
this.fileType = options.fileType;
this.mode = options.mode;
Common.NotificationCenter.on({
'window:resize': _.bind(function() {
var divided = Common.Utils.innerWidth() >= this.maxWidth;
if (this.isDivided !== divided) {
this.$el.find('.divider').css('width', divided ? '100%' : '0');
this.isDivided = divided;
}
}, this)
});
},
render: function() {
@ -125,6 +135,21 @@ define([
});
}
var itemWidth = 70 + 24, // width + margin
maxCount = 0;
this.formats.forEach(_.bind(function (item, index) {
var count = item.length;
if (count > maxCount) {
maxCount = count;
}
}, this));
this.maxWidth = $('#file-menu-panel .panel-menu').outerWidth() + 20 + 10 + itemWidth * maxCount; // menu + left padding + margin
if (Common.Utils.innerWidth() >= this.maxWidth) {
this.$el.find('.divider').css('width', '100%');
this.isDivided = true;
}
return this;
},

View file

@ -82,7 +82,12 @@
}
}
#panel-saveas, #panel-savecopy {
#file-menu-panel .panel-context {
#panel-saveas, #panel-savecopy {
&.content-box {
padding: 0 0 0 20px;
}
.content-container {
margin: 30px 0 0 10px;
@ -108,13 +113,8 @@
height: 0;
}
@media(min-width: 800px) {
.divider {
width: 100%;
}
}
}
}
}