Skip to content

Commit c107d46

Browse files
committed
Auto-adjust window location when taller than page
1 parent 711f0f8 commit c107d46

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

SequenceAnalysis/resources/web/SequenceAnalysis/panel/AnalysisSectionPanel.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99
Ext4.define('SequenceAnalysis.panel.AnalysisSectionPanel', {
1010
extend: 'Ext.form.Panel',
11+
// TODO: align to top of window
1112
alias: 'widget.sequenceanalysis-analysissectionpanel',
1213
singleTool: false,
1314
allowDuplicateSteps: false,
@@ -195,7 +196,8 @@ Ext4.define('SequenceAnalysis.panel.AnalysisSectionPanel', {
195196
});
196197
}
197198

198-
Ext4.create('Ext.window.Window', {
199+
// TODO: alignment
200+
var win = Ext4.create('Ext.window.Window', {
199201
modal: true,
200202
ownerPanel: this,
201203
bodyStyle: 'padding: 5px;',
@@ -211,8 +213,16 @@ Ext4.define('SequenceAnalysis.panel.AnalysisSectionPanel', {
211213
handler: function(btn){
212214
btn.up('window').close();
213215
}
214-
}]
215-
}).show(btn);
216+
}],
217+
listeners: {
218+
show: function(win){
219+
if (win.getHeight() > Ext4.getBody().getHeight()) {
220+
win.alignTo(Ext4.getBody(), 't-t?');
221+
}
222+
}
223+
}
224+
});
225+
win.show(btn);
216226
},
217227

218228
getDescriptionButton: function(cfg){

0 commit comments

Comments
 (0)