VE dialog: Reset scroll offsets on teardown
Change-Id: Ieb252188948249c992a7e43117781f5fdf159d5b
This commit is contained in:
parent
954b37599a
commit
c4e0340e46
|
@ -60,21 +60,14 @@ ve.ui.MWLatexDialog.prototype.initialize = function () {
|
||||||
ve.ui.MWLatexDialog.super.prototype.initialize.call( this );
|
ve.ui.MWLatexDialog.super.prototype.initialize.call( this );
|
||||||
|
|
||||||
// Layout for the formula inserter (formula tab panel) and options form (options tab panel)
|
// Layout for the formula inserter (formula tab panel) and options form (options tab panel)
|
||||||
this.indexLayout = new OO.ui.IndexLayout( {
|
this.indexLayout = new OO.ui.IndexLayout();
|
||||||
scrollable: false,
|
|
||||||
expanded: true
|
|
||||||
} );
|
|
||||||
|
|
||||||
formulaTabPanel = new OO.ui.TabPanelLayout( 'formula', {
|
formulaTabPanel = new OO.ui.TabPanelLayout( 'formula', {
|
||||||
label: ve.msg( 'math-visualeditor-mwlatexdialog-card-formula' ),
|
label: ve.msg( 'math-visualeditor-mwlatexdialog-card-formula' ),
|
||||||
expandable: false,
|
|
||||||
scrollable: false,
|
|
||||||
padded: true
|
padded: true
|
||||||
} );
|
} );
|
||||||
optionsTabPanel = new OO.ui.TabPanelLayout( 'options', {
|
optionsTabPanel = new OO.ui.TabPanelLayout( 'options', {
|
||||||
label: ve.msg( 'math-visualeditor-mwlatexdialog-card-options' ),
|
label: ve.msg( 'math-visualeditor-mwlatexdialog-card-options' ),
|
||||||
expandable: false,
|
|
||||||
scrollable: false,
|
|
||||||
padded: true
|
padded: true
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -137,6 +130,7 @@ ve.ui.MWLatexDialog.prototype.initialize = function () {
|
||||||
} );
|
} );
|
||||||
|
|
||||||
formulaPanel = new OO.ui.PanelLayout( {
|
formulaPanel = new OO.ui.PanelLayout( {
|
||||||
|
scrollable: true,
|
||||||
padded: true
|
padded: true
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -166,16 +160,12 @@ ve.ui.MWLatexDialog.prototype.initialize = function () {
|
||||||
);
|
);
|
||||||
|
|
||||||
// Append everything
|
// Append everything
|
||||||
dialog.menuLayout.$menu.append(
|
formulaPanel.$element.append(
|
||||||
dialog.bookletLayout.$element
|
dialog.previewElement.$element,
|
||||||
);
|
inputField.$element
|
||||||
|
|
||||||
dialog.menuLayout.$content.append(
|
|
||||||
formulaPanel.$element.append(
|
|
||||||
dialog.previewElement.$element,
|
|
||||||
inputField.$element
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
dialog.menuLayout.setMenuPanel( dialog.bookletLayout );
|
||||||
|
dialog.menuLayout.setContentPanel( formulaPanel );
|
||||||
|
|
||||||
formulaTabPanel.$element.append(
|
formulaTabPanel.$element.append(
|
||||||
dialog.menuLayout.$element
|
dialog.menuLayout.$element
|
||||||
|
@ -239,6 +229,10 @@ ve.ui.MWLatexDialog.prototype.getTeardownProcess = function ( data ) {
|
||||||
this.displaySelect.off( 'choose', this.onChangeHandler );
|
this.displaySelect.off( 'choose', this.onChangeHandler );
|
||||||
this.idInput.off( 'change', this.onChangeHandler );
|
this.idInput.off( 'change', this.onChangeHandler );
|
||||||
this.getManager().disconnect( this );
|
this.getManager().disconnect( this );
|
||||||
|
this.indexLayout.setTabPanel( 'formula' );
|
||||||
|
this.indexLayout.resetScroll();
|
||||||
|
this.menuLayout.resetScroll();
|
||||||
|
this.bookletLayout.resetScroll();
|
||||||
}, this );
|
}, this );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue