Merge branch 'develop' into feature/rtl-support

This commit is contained in:
JuliaSvinareva
2023-01-09 21:08:12 +03:00
409 changed files with 10756 additions and 6270 deletions

View File

@ -158,7 +158,8 @@ define([
maxheight: undefined,
minwidth: 0,
minheight: 0,
enableKeyEvents: true
enableKeyEvents: true,
automove: true
};
var template = '<div class="asc-window<%= modal?" modal":"" %><%= cls?" "+cls:"" %>" id="<%= id %>" style="width:<%= width %>px;">' +
@ -265,8 +266,10 @@ define([
var top = main_geometry.top + Math.floor((parseInt(main_height) - parseInt(win_height)) / 2);
var left = Math.floor((parseInt(main_width) - parseInt(win_width)) / 2);
this.$window.css('left',left);
this.$window.css('top',top);
this.$window.css({
left: left < 0 ? 0 : left,
top: top < 0 ? 0 : top
});
}
function _setVisible() {
@ -355,6 +358,23 @@ define([
}
}
function _onResizeMove(){
var main_geometry = _readDocumetGeometry(),
main_width = main_geometry.width,
main_height = main_geometry.height,
win_height = this.getHeight(),
win_width = this.getWidth(),
top = this.getTop(),
left = this.getLeft();
top = top + win_height > main_height ? main_height - win_height : top;
left = left + win_width > main_width ? main_width - win_width : left;
this.$window.css({
left: left < 0 ? 0 : left,
top: top < 0 ? 0 : top
});
}
/* window resize functions */
function _resizestart(event) {
@ -501,7 +521,7 @@ define([
body.height(parseInt(text_cnt.css('height')) + parseInt(footer.css('height')));
window.setHeight(parseInt(body.css('height')) + parseInt(header.css('height')));
}
if (text.height() < icon_height-10)
if (text.height() < icon_height/2)
text.css({'vertical-align': 'baseline', 'line-height': icon_height+'px'});
}
@ -659,7 +679,6 @@ define([
this.$window.find('.header').on('mousedown', this.binding.dragStart);
this.$window.find('.tool.close').on('click', _.bind(doclose, this));
this.$window.find('.tool.help').on('click', _.bind(dohelp, this));
if (!this.initConfig.modal)
Common.Gateway.on('processmouse', _.bind(_onProcessMouse, this));
} else {
@ -743,6 +762,10 @@ define([
}
$(document).on('keydown.' + this.cid, this.binding.keydown);
if(this.initConfig.automove){
this.binding.windowresize = _.bind(_onResizeMove, this);
$(window).on('resize', this.binding.windowresize);
}
var me = this;
@ -794,6 +817,7 @@ define([
close: function(suppressevent) {
$(document).off('keydown.' + this.cid);
this.initConfig.automove && $(window).off('resize', this.binding.windowresize);
if ( this.initConfig.header ) {
this.$window.find('.header').off('mousedown', this.binding.dragStart);
}
@ -839,6 +863,7 @@ define([
hide: function() {
$(document).off('keydown.' + this.cid);
this.initConfig.automove && $(window).off('resize', this.binding.windowresize);
if (this.$window) {
if (this.initConfig.modal) {
var mask = _getMask(),