Fix menu show in dialogs
This commit is contained in:
parent
3e352d5c80
commit
4ea5c2522e
|
@ -594,7 +594,7 @@ define([
|
||||||
Common.UI.BaseView.prototype.initialize.call(this, this.initConfig);
|
Common.UI.BaseView.prototype.initialize.call(this, this.initConfig);
|
||||||
},
|
},
|
||||||
|
|
||||||
render : function() {
|
render: function() {
|
||||||
var renderto = this.initConfig.renderTo || document.body;
|
var renderto = this.initConfig.renderTo || document.body;
|
||||||
$(renderto).append(
|
$(renderto).append(
|
||||||
_.template(template)(this.initConfig)
|
_.template(template)(this.initConfig)
|
||||||
|
@ -651,6 +651,22 @@ define([
|
||||||
|
|
||||||
this.initConfig.footerCls && this.$window.find('.footer').addClass(this.initConfig.footerCls);
|
this.initConfig.footerCls && this.$window.find('.footer').addClass(this.initConfig.footerCls);
|
||||||
|
|
||||||
|
this.menuAddAlign = function(menuRoot, left, top) {
|
||||||
|
var self = this;
|
||||||
|
if (!me.$window.hasClass('notransform')) {
|
||||||
|
me.$window.addClass('notransform');
|
||||||
|
menuRoot.addClass('hidden');
|
||||||
|
setTimeout(function() {
|
||||||
|
menuRoot.removeClass('hidden');
|
||||||
|
menuRoot.css({left: left, top: top});
|
||||||
|
self.options.additionalAlign = null;
|
||||||
|
}, 300);
|
||||||
|
} else {
|
||||||
|
menuRoot.css({left: left, top: top});
|
||||||
|
self.options.additionalAlign = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
this.fireEvent('render:after',this);
|
this.fireEvent('render:after',this);
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
|
@ -107,22 +107,6 @@ define([
|
||||||
this.content_panels = $window.find('.settings-panel');
|
this.content_panels = $window.find('.settings-panel');
|
||||||
if (this.btnsCategory.length>0)
|
if (this.btnsCategory.length>0)
|
||||||
this.btnsCategory[0].toggle(true, true);
|
this.btnsCategory[0].toggle(true, true);
|
||||||
|
|
||||||
me.menuAddAlign = function(menuRoot, left, top) {
|
|
||||||
var self = this;
|
|
||||||
if (!$window.hasClass('notransform')) {
|
|
||||||
$window.addClass('notransform');
|
|
||||||
menuRoot.addClass('hidden');
|
|
||||||
setTimeout(function() {
|
|
||||||
menuRoot.removeClass('hidden');
|
|
||||||
menuRoot.css({left: left, top: top});
|
|
||||||
self.options.additionalAlign = null;
|
|
||||||
}, 300);
|
|
||||||
} else {
|
|
||||||
menuRoot.css({left: left, top: top});
|
|
||||||
self.options.additionalAlign = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
setHeight: function(height) {
|
setHeight: function(height) {
|
||||||
|
|
|
@ -103,22 +103,6 @@ define([
|
||||||
$window = this.getChild();
|
$window = this.getChild();
|
||||||
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
||||||
|
|
||||||
this.menuAddAlign = function(menuRoot, left, top) {
|
|
||||||
var self = this;
|
|
||||||
if (!$window.hasClass('notransform')) {
|
|
||||||
$window.addClass('notransform');
|
|
||||||
menuRoot.addClass('hidden');
|
|
||||||
setTimeout(function() {
|
|
||||||
menuRoot.removeClass('hidden');
|
|
||||||
menuRoot.css({left: left, top: top});
|
|
||||||
self.options.additionalAlign = null;
|
|
||||||
}, 300);
|
|
||||||
} else {
|
|
||||||
menuRoot.css({left: left, top: top});
|
|
||||||
self.options.additionalAlign = null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
this.spnSize = new Common.UI.MetricSpinner({
|
this.spnSize = new Common.UI.MetricSpinner({
|
||||||
el : $window.find('#id-dlg-list-size'),
|
el : $window.find('#id-dlg-list-size'),
|
||||||
step : 1,
|
step : 1,
|
||||||
|
|
|
@ -154,22 +154,6 @@ define([
|
||||||
$window = this.getChild();
|
$window = this.getChild();
|
||||||
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
||||||
|
|
||||||
this.menuAddAlign = function(menuRoot, left, top) {
|
|
||||||
var self = this;
|
|
||||||
if (!$window.hasClass('notransform')) {
|
|
||||||
$window.addClass('notransform');
|
|
||||||
menuRoot.addClass('hidden');
|
|
||||||
setTimeout(function() {
|
|
||||||
menuRoot.removeClass('hidden');
|
|
||||||
menuRoot.css({left: left, top: top});
|
|
||||||
self.options.additionalAlign = null;
|
|
||||||
}, 300);
|
|
||||||
} else {
|
|
||||||
menuRoot.css({left: left, top: top});
|
|
||||||
self.options.additionalAlign = null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
this.btnColor = new Common.UI.ColorButton({
|
this.btnColor = new Common.UI.ColorButton({
|
||||||
style: 'width:45px;',
|
style: 'width:45px;',
|
||||||
menu : new Common.UI.Menu({
|
menu : new Common.UI.Menu({
|
||||||
|
|
|
@ -475,6 +475,7 @@ define([
|
||||||
panel.btnPresetsTop.setMenu(new Common.UI.Menu({
|
panel.btnPresetsTop.setMenu(new Common.UI.Menu({
|
||||||
style: 'min-width: 100px;',
|
style: 'min-width: 100px;',
|
||||||
maxHeight: 200,
|
maxHeight: 200,
|
||||||
|
additionalAlign: panel.menuAddAlign,
|
||||||
items: data
|
items: data
|
||||||
}));
|
}));
|
||||||
data = ((selectdata) ? [{caption: this.textSelectRange + '...', value: 'select'}] : []).concat([
|
data = ((selectdata) ? [{caption: this.textSelectRange + '...', value: 'select'}] : []).concat([
|
||||||
|
@ -486,6 +487,7 @@ define([
|
||||||
panel.btnPresetsLeft.setMenu(new Common.UI.Menu({
|
panel.btnPresetsLeft.setMenu(new Common.UI.Menu({
|
||||||
style: 'min-width: 100px;',
|
style: 'min-width: 100px;',
|
||||||
maxHeight: 200,
|
maxHeight: 200,
|
||||||
|
additionalAlign: panel.menuAddAlign,
|
||||||
items: data
|
items: data
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
@ -495,6 +497,9 @@ define([
|
||||||
if (item.value == 'select') {
|
if (item.value == 'select') {
|
||||||
var me = this;
|
var me = this;
|
||||||
if (me.api) {
|
if (me.api) {
|
||||||
|
panel.btnPresetsTop.menu.options.additionalAlign = panel.menuAddAlign;
|
||||||
|
panel.btnPresetsLeft.menu.options.additionalAlign = panel.menuAddAlign;
|
||||||
|
|
||||||
var handlerDlg = function(dlg, result) {
|
var handlerDlg = function(dlg, result) {
|
||||||
if (result == 'ok') {
|
if (result == 'ok') {
|
||||||
var valid = dlg.getSettings();
|
var valid = dlg.getSettings();
|
||||||
|
|
|
@ -1512,6 +1512,9 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
|
||||||
onSelectData: function() {
|
onSelectData: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
if (me.api) {
|
if (me.api) {
|
||||||
|
me.btnChartType.menu.options.additionalAlign = me.menuAddAlign;
|
||||||
|
me.btnSparkType.menu.options.additionalAlign = me.menuAddAlign;
|
||||||
|
|
||||||
var handlerDlg = function(dlg, result) {
|
var handlerDlg = function(dlg, result) {
|
||||||
if (result == 'ok') {
|
if (result == 'ok') {
|
||||||
me.dataRangeValid = dlg.getSettings();
|
me.dataRangeValid = dlg.getSettings();
|
||||||
|
|
|
@ -163,22 +163,6 @@ define([
|
||||||
render: function() {
|
render: function() {
|
||||||
Common.UI.Window.prototype.render.call(this);
|
Common.UI.Window.prototype.render.call(this);
|
||||||
|
|
||||||
this.menuAddAlign = function(menuRoot, left, top) {
|
|
||||||
var self = this;
|
|
||||||
if (!$window.hasClass('notransform')) {
|
|
||||||
$window.addClass('notransform');
|
|
||||||
menuRoot.addClass('hidden');
|
|
||||||
setTimeout(function() {
|
|
||||||
menuRoot.removeClass('hidden');
|
|
||||||
menuRoot.css({left: left, top: top});
|
|
||||||
self.options.additionalAlign = null;
|
|
||||||
}, 300);
|
|
||||||
} else {
|
|
||||||
menuRoot.css({left: left, top: top});
|
|
||||||
self.options.additionalAlign = null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var me = this,
|
var me = this,
|
||||||
$window = this.getChild();
|
$window = this.getChild();
|
||||||
|
|
||||||
|
|
|
@ -104,21 +104,6 @@ define([
|
||||||
Common.UI.Window.prototype.render.call(this);
|
Common.UI.Window.prototype.render.call(this);
|
||||||
|
|
||||||
var me = this;
|
var me = this;
|
||||||
this.menuAddAlign = function(menuRoot, left, top) {
|
|
||||||
var self = this;
|
|
||||||
if (!$window.hasClass('notransform')) {
|
|
||||||
$window.addClass('notransform');
|
|
||||||
menuRoot.addClass('hidden');
|
|
||||||
setTimeout(function() {
|
|
||||||
menuRoot.removeClass('hidden');
|
|
||||||
menuRoot.css({left: left, top: top});
|
|
||||||
self.options.additionalAlign = null;
|
|
||||||
}, 300);
|
|
||||||
} else {
|
|
||||||
menuRoot.css({left: left, top: top});
|
|
||||||
self.options.additionalAlign = null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
this.txtRangeTop = new Common.UI.InputFieldBtn({
|
this.txtRangeTop = new Common.UI.InputFieldBtn({
|
||||||
el : $('#print-titles-txt-top'),
|
el : $('#print-titles-txt-top'),
|
||||||
|
@ -256,6 +241,9 @@ define([
|
||||||
if (item.value == 'select') {
|
if (item.value == 'select') {
|
||||||
var me = this;
|
var me = this;
|
||||||
if (me.api) {
|
if (me.api) {
|
||||||
|
me.btnPresetsTop.menu.options.additionalAlign = me.menuAddAlign;
|
||||||
|
me.btnPresetsLeft.menu.options.additionalAlign = me.menuAddAlign;
|
||||||
|
|
||||||
var handlerDlg = function(dlg, result) {
|
var handlerDlg = function(dlg, result) {
|
||||||
if (result == 'ok') {
|
if (result == 'ok') {
|
||||||
var valid = dlg.getSettings();
|
var valid = dlg.getSettings();
|
||||||
|
|
Loading…
Reference in a new issue