Pass $overlay to widgets that need it

Also change this.$overlay (which doesn't even exist) to
config.$overlay in MWTemplatePlaceholderPage and document it.

Compensates for I39df86373ea in oojs-ui.

Change-Id: I4a233c058439d6cfb38d80ece890c8fe57d58f49
This commit is contained in:
Roan Kattouw 2014-10-27 17:36:19 -07:00
parent 0dad360036
commit 61e8115e8b
3 changed files with 8 additions and 2 deletions

View file

@ -83,6 +83,7 @@ ve.ui.MWReferencesListDialog.prototype.initialize = function () {
this.groupInput = new ve.ui.MWReferenceGroupInputWidget( {
$: this.$,
$overlay: this.$overlay,
emptyGroupName: ve.msg( 'visualeditor-dialog-reference-options-group-placeholder' )
} );
this.groupField = new OO.ui.FieldLayout( this.groupInput, {

View file

@ -254,7 +254,11 @@ ve.ui.MWTemplateDialog.prototype.getPageFromPart = function ( part ) {
if ( part instanceof ve.dm.MWTemplateModel ) {
return new ve.ui.MWTemplatePage( part, part.getId(), { $: this.$ } );
} else if ( part instanceof ve.dm.MWTemplatePlaceholderModel ) {
return new ve.ui.MWTemplatePlaceholderPage( part, part.getId(), { $: this.$ } );
return new ve.ui.MWTemplatePlaceholderPage(
part,
part.getId(),
{ $: this.$, $overlay: this.$overlay }
);
}
return null;
};

View file

@ -15,6 +15,7 @@
* @param {ve.dm.MWTemplatePlaceholderModel} placeholder Template placeholder
* @param {string} name Unique symbolic name of page
* @param {Object} [config] Configuration options
* @cfg {jQuery} [$overlay] Overlay for dropdowns
*/
ve.ui.MWTemplatePlaceholderPage = function VeUiMWTemplatePlaceholderPage( placeholder, name, config ) {
// Configuration initialization
@ -29,7 +30,7 @@ ve.ui.MWTemplatePlaceholderPage = function VeUiMWTemplatePlaceholderPage( placeh
this.placeholder = placeholder;
this.addTemplateInput = new ve.ui.MWTitleInputWidget( {
$: this.$, $overlay: this.$overlay, namespace: 10
$: this.$, $overlay: config.$overlay, namespace: 10
} )
.connect( this, {
change: 'onTemplateInputChange',