Merge pull request #2138 from ONLYOFFICE/feature/shift-on-window-resize
shift on window resize
This commit is contained in:
commit
1fc747a702
|
@ -158,7 +158,8 @@ define([
|
||||||
maxheight: undefined,
|
maxheight: undefined,
|
||||||
minwidth: 0,
|
minwidth: 0,
|
||||||
minheight: 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;">' +
|
var template = '<div class="asc-window<%= modal?" modal":"" %><%= cls?" "+cls:"" %>" id="<%= id %>" style="width:<%= width %>px;">' +
|
||||||
|
@ -677,7 +678,6 @@ define([
|
||||||
this.$window.find('.header').on('mousedown', this.binding.dragStart);
|
this.$window.find('.header').on('mousedown', this.binding.dragStart);
|
||||||
this.$window.find('.tool.close').on('click', _.bind(doclose, this));
|
this.$window.find('.tool.close').on('click', _.bind(doclose, this));
|
||||||
this.$window.find('.tool.help').on('click', _.bind(dohelp, this));
|
this.$window.find('.tool.help').on('click', _.bind(dohelp, this));
|
||||||
$(window).on('resize', _.bind(_onResizeMove, this));
|
|
||||||
if (!this.initConfig.modal)
|
if (!this.initConfig.modal)
|
||||||
Common.Gateway.on('processmouse', _.bind(_onProcessMouse, this));
|
Common.Gateway.on('processmouse', _.bind(_onProcessMouse, this));
|
||||||
} else {
|
} else {
|
||||||
|
@ -761,6 +761,10 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('keydown.' + this.cid, this.binding.keydown);
|
$(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;
|
var me = this;
|
||||||
|
|
||||||
|
@ -812,6 +816,7 @@ define([
|
||||||
|
|
||||||
close: function(suppressevent) {
|
close: function(suppressevent) {
|
||||||
$(document).off('keydown.' + this.cid);
|
$(document).off('keydown.' + this.cid);
|
||||||
|
this.initConfig.automove && $(window).off('resize', this.binding.windowresize);
|
||||||
if ( this.initConfig.header ) {
|
if ( this.initConfig.header ) {
|
||||||
this.$window.find('.header').off('mousedown', this.binding.dragStart);
|
this.$window.find('.header').off('mousedown', this.binding.dragStart);
|
||||||
}
|
}
|
||||||
|
@ -857,6 +862,7 @@ define([
|
||||||
|
|
||||||
hide: function() {
|
hide: function() {
|
||||||
$(document).off('keydown.' + this.cid);
|
$(document).off('keydown.' + this.cid);
|
||||||
|
this.initConfig.automove && $(window).off('resize', this.binding.windowresize);
|
||||||
if (this.$window) {
|
if (this.$window) {
|
||||||
if (this.initConfig.modal) {
|
if (this.initConfig.modal) {
|
||||||
var mask = _getMask(),
|
var mask = _getMask(),
|
||||||
|
|
|
@ -54,7 +54,8 @@ define([
|
||||||
var _options = {};
|
var _options = {};
|
||||||
_.extend(_options, {
|
_.extend(_options, {
|
||||||
header: true,
|
header: true,
|
||||||
enableKeyEvents: false
|
enableKeyEvents: false,
|
||||||
|
automove: false
|
||||||
}, options);
|
}, options);
|
||||||
|
|
||||||
var header_footer = (_options.buttons && _.size(_options.buttons)>0) ? 85 : 34;
|
var header_footer = (_options.buttons && _.size(_options.buttons)>0) ? 85 : 34;
|
||||||
|
|
|
@ -85,6 +85,7 @@ define([
|
||||||
height: 120,
|
height: 120,
|
||||||
header: false,
|
header: false,
|
||||||
modal: false,
|
modal: false,
|
||||||
|
automove: false,
|
||||||
alias: 'Common.Views.ReviewPopover'
|
alias: 'Common.Views.ReviewPopover'
|
||||||
}, options);
|
}, options);
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,8 @@ define([
|
||||||
cls: 'search-bar',
|
cls: 'search-bar',
|
||||||
alias: 'SearchBar',
|
alias: 'SearchBar',
|
||||||
showOpenPanel: true,
|
showOpenPanel: true,
|
||||||
toolclose: 'hide'
|
toolclose: 'hide',
|
||||||
|
automove: false
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize : function(options) {
|
initialize : function(options) {
|
||||||
|
|
|
@ -2932,7 +2932,7 @@ define([
|
||||||
this.lockToolbar(Common.enumLock.cantPrint, true, {array: [this.btnPrint]});
|
this.lockToolbar(Common.enumLock.cantPrint, true, {array: [this.btnPrint]});
|
||||||
} else {
|
} else {
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
!mode.canPrint && this.btnPrint.hide();
|
!mode.canPrint && this.btnPrint && this.btnPrint.hide();
|
||||||
this.lockToolbar(Common.enumLock.cantPrint, !mode.canPrint, {array: [this.btnPrint]});
|
this.lockToolbar(Common.enumLock.cantPrint, !mode.canPrint, {array: [this.btnPrint]});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue