2022-06-20 12:47:59 +00:00
|
|
|
/**
|
|
|
|
* Specialized layout similar to BookletLayout, but to synchronize the sidebar
|
|
|
|
* and content pane of the transclusion dialog
|
|
|
|
*
|
|
|
|
* Also owns the outline controls.
|
|
|
|
*
|
2022-06-22 07:03:46 +00:00
|
|
|
* This class has domain knowledge about its contents, for example different
|
|
|
|
* behaviors for template vs template parameter elements.
|
|
|
|
*
|
2022-06-20 12:47:59 +00:00
|
|
|
* @class
|
|
|
|
* @extends OO.ui.MenuLayout
|
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
* @cfg {boolean} [outlined=false] Show the outline. The outline is used to navigate through the
|
|
|
|
* pages of the booklet.
|
2022-06-24 12:42:33 +00:00
|
|
|
* @property {Object.<string,OO.ui.PageLayout>} pages
|
2022-06-20 12:47:59 +00:00
|
|
|
*/
|
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout = function VeUiMWTwoPaneTransclusionDialogLayout( config ) {
|
|
|
|
// Configuration initialization
|
|
|
|
config = config || {};
|
|
|
|
|
|
|
|
// Parent constructor
|
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.super.call( this, config );
|
|
|
|
|
|
|
|
// Properties
|
|
|
|
this.currentPageName = null;
|
|
|
|
this.pages = {};
|
|
|
|
this.ignoreFocus = false;
|
2022-07-06 14:04:18 +00:00
|
|
|
this.stackLayout = new ve.ui.MWVerticalLayout();
|
2022-06-20 12:47:59 +00:00
|
|
|
this.setContentPanel( this.stackLayout );
|
2022-06-21 13:46:21 +00:00
|
|
|
this.sidebar = new ve.ui.MWTransclusionOutlineWidget();
|
2022-06-20 12:47:59 +00:00
|
|
|
this.outlineVisible = false;
|
|
|
|
this.outlined = !!config.outlined;
|
|
|
|
if ( this.outlined ) {
|
|
|
|
this.outlinePanel = new OO.ui.PanelLayout( {
|
|
|
|
expanded: this.expanded,
|
|
|
|
scrollable: true
|
|
|
|
} );
|
|
|
|
this.setMenuPanel( this.outlinePanel );
|
|
|
|
this.outlineVisible = true;
|
2022-06-27 14:46:08 +00:00
|
|
|
this.outlineControlsWidget = new ve.ui.MWTransclusionOutlineControlsWidget();
|
2022-06-20 12:47:59 +00:00
|
|
|
}
|
|
|
|
this.toggleMenu( this.outlined );
|
|
|
|
|
|
|
|
// Events
|
2022-06-24 13:33:20 +00:00
|
|
|
this.sidebar.connect( this, {
|
2022-06-30 14:32:39 +00:00
|
|
|
filterPagesByName: 'onFilterPagesByName',
|
2022-07-04 08:41:37 +00:00
|
|
|
sidebarPartSelected: 'onSidebarItemSelected',
|
2022-07-15 12:24:26 +00:00
|
|
|
templateParameterSelected: 'onSidebarItemSelected'
|
2022-06-24 13:33:20 +00:00
|
|
|
} );
|
2022-06-23 09:00:15 +00:00
|
|
|
// Event 'focus' does not bubble, but 'focusin' does
|
|
|
|
this.stackLayout.$element.on( 'focusin', this.onStackLayoutFocus.bind( this ) );
|
2022-06-20 12:47:59 +00:00
|
|
|
|
|
|
|
// Initialization
|
|
|
|
this.$element.addClass( 've-ui-mwTwoPaneTransclusionDialogLayout' );
|
|
|
|
this.stackLayout.$element.addClass( 've-ui-mwTwoPaneTransclusionDialogLayout-stackLayout' );
|
|
|
|
if ( this.outlined ) {
|
|
|
|
this.outlinePanel.$element
|
2022-06-23 08:47:42 +00:00
|
|
|
.addClass( 've-ui-mwTwoPaneTransclusionDialogLayout-outlinePanel' )
|
2022-06-21 13:15:06 +00:00
|
|
|
.append(
|
|
|
|
$( '<div>' ).addClass( 've-ui-mwTwoPaneTransclusionDialogLayout-sidebar-container' )
|
|
|
|
.append( this.sidebar.$element ),
|
|
|
|
this.outlineControlsWidget.$element
|
|
|
|
);
|
2022-06-20 12:47:59 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Setup */
|
|
|
|
|
|
|
|
OO.inheritClass( ve.ui.MWTwoPaneTransclusionDialogLayout, OO.ui.MenuLayout );
|
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
2022-06-24 13:33:20 +00:00
|
|
|
/**
|
|
|
|
* @private
|
2022-07-12 18:10:02 +00:00
|
|
|
* @param {Object.<string,boolean>} visibility
|
2022-06-24 13:33:20 +00:00
|
|
|
*/
|
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.onFilterPagesByName = function ( visibility ) {
|
|
|
|
for ( var pageName in visibility ) {
|
|
|
|
var page = this.getPage( pageName );
|
|
|
|
if ( page ) {
|
|
|
|
page.toggle( visibility[ pageName ] );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2022-06-24 12:42:33 +00:00
|
|
|
/**
|
|
|
|
* @param {ve.dm.MWTransclusionPartModel|null} removed Removed part
|
|
|
|
* @param {ve.dm.MWTransclusionPartModel|null} added Added part
|
|
|
|
* @param {number} [newPosition]
|
|
|
|
*/
|
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.onReplacePart = function ( removed, added, newPosition ) {
|
|
|
|
this.sidebar.onReplacePart( removed, added, newPosition );
|
|
|
|
|
|
|
|
var keys = Object.keys( this.pages ),
|
|
|
|
isLastPlaceholder = keys.length === 1 &&
|
|
|
|
this.pages[ keys[ 0 ] ] instanceof ve.ui.MWTemplatePlaceholderPage;
|
|
|
|
// TODO: In other cases this is disabled rather than hidden. See T311303
|
|
|
|
this.outlineControlsWidget.removeButton.toggle( !isLastPlaceholder );
|
|
|
|
};
|
|
|
|
|
2022-06-20 12:47:59 +00:00
|
|
|
/**
|
|
|
|
* Handle stack layout focus.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @param {jQuery.Event} e Focusin event
|
|
|
|
*/
|
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.onStackLayoutFocus = function ( e ) {
|
|
|
|
// Find the page that an element was focused within
|
2022-06-23 14:47:51 +00:00
|
|
|
var $target = $( e.target ).closest( '.oo-ui-pageLayout' );
|
|
|
|
for ( var name in this.pages ) {
|
2022-06-20 12:47:59 +00:00
|
|
|
// Check for page match, exclude current page to find only page changes
|
|
|
|
if ( this.pages[ name ].$element[ 0 ] === $target[ 0 ] && name !== this.currentPageName ) {
|
|
|
|
this.setPage( name );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2022-07-04 08:40:02 +00:00
|
|
|
* Focus the input field for the current page.
|
2022-06-20 12:47:59 +00:00
|
|
|
*
|
|
|
|
* If no page is selected, the first selectable page will be selected.
|
|
|
|
* If the focus is already in an element on the current page, nothing will happen.
|
|
|
|
*/
|
2022-06-27 10:31:32 +00:00
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.focus = function () {
|
2022-07-04 08:40:35 +00:00
|
|
|
var page = this.pages[ this.currentPageName ];
|
2022-06-20 12:47:59 +00:00
|
|
|
|
|
|
|
if ( !page ) {
|
|
|
|
return;
|
|
|
|
}
|
2022-07-06 12:47:50 +00:00
|
|
|
// Only change the focus if it's visible and is not already the current page
|
|
|
|
if ( page.$element[ 0 ].offsetParent !== null &&
|
|
|
|
!OO.ui.contains( page.$element[ 0 ], this.getElementDocument().activeElement, true )
|
|
|
|
) {
|
2022-06-20 12:47:59 +00:00
|
|
|
page.focus();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2022-06-27 12:33:00 +00:00
|
|
|
/**
|
|
|
|
* @param {string} pageName
|
|
|
|
*/
|
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.focusPart = function ( pageName ) {
|
2022-07-04 11:36:09 +00:00
|
|
|
this.setPage( pageName );
|
|
|
|
this.focus();
|
2022-06-27 12:33:00 +00:00
|
|
|
};
|
|
|
|
|
2022-06-30 14:32:39 +00:00
|
|
|
/**
|
2022-07-04 08:41:37 +00:00
|
|
|
* Parts and parameters can be soft-selected, or selected and focused.
|
|
|
|
*
|
2022-07-12 11:43:24 +00:00
|
|
|
* @param {string|null} pageName Full, unique name of part or parameter, or null to deselect
|
2022-07-12 18:10:02 +00:00
|
|
|
* @param {boolean} [soft] If true, suppress content pane focus.
|
2022-06-30 14:32:39 +00:00
|
|
|
*/
|
2022-07-04 08:41:37 +00:00
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.onSidebarItemSelected = function ( pageName, soft ) {
|
2022-07-04 11:36:09 +00:00
|
|
|
this.setPage( pageName );
|
2022-07-04 08:41:37 +00:00
|
|
|
if ( !soft ) {
|
|
|
|
this.focus();
|
|
|
|
}
|
2022-07-12 14:56:50 +00:00
|
|
|
|
|
|
|
var page = this.pages[ pageName ];
|
|
|
|
if ( page ) {
|
|
|
|
page.scrollElementIntoView( { alignToTop: true, padding: { top: 20 } } );
|
|
|
|
}
|
2022-06-30 14:32:39 +00:00
|
|
|
};
|
|
|
|
|
2022-06-20 12:47:59 +00:00
|
|
|
/**
|
|
|
|
* Check if booklet has an outline.
|
|
|
|
*
|
|
|
|
* @return {boolean} Booklet has an outline
|
|
|
|
*/
|
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.isOutlined = function () {
|
|
|
|
return this.outlined;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Check if booklet has a visible outline.
|
|
|
|
*
|
|
|
|
* @return {boolean} Outline is visible
|
|
|
|
*/
|
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.isOutlineVisible = function () {
|
|
|
|
return this.outlined && this.outlineVisible;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Hide or show the outline.
|
|
|
|
*
|
|
|
|
* @param {boolean} [show] Show outline, omit to invert current state
|
|
|
|
*/
|
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.toggleOutline = function ( show ) {
|
2022-06-23 14:47:51 +00:00
|
|
|
if ( !this.outlined ) {
|
|
|
|
return;
|
2022-06-20 12:47:59 +00:00
|
|
|
}
|
|
|
|
|
2022-06-23 14:47:51 +00:00
|
|
|
show = show === undefined ? !this.outlineVisible : !!show;
|
|
|
|
this.outlineVisible = show;
|
|
|
|
this.toggleMenu( show );
|
2022-06-23 08:47:42 +00:00
|
|
|
if ( show ) {
|
2022-06-23 14:47:51 +00:00
|
|
|
var booklet = this;
|
|
|
|
// HACK: Kill dumb scrollbars when the sidebar stops animating, see T161798.
|
|
|
|
// Only necessary when outline controls are present, delay matches transition on
|
|
|
|
// `.oo-ui-menuLayout-menu`.
|
|
|
|
setTimeout( function () {
|
|
|
|
OO.ui.Element.static.reconsiderScrollbars( booklet.outlinePanel.$element[ 0 ] );
|
|
|
|
}, OO.ui.theme.getDialogTransitionDuration() );
|
|
|
|
}
|
2022-06-20 12:47:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2022-06-23 08:47:42 +00:00
|
|
|
* @return {ve.ui.MWTransclusionOutlineControlsWidget|null}
|
2022-06-20 12:47:59 +00:00
|
|
|
*/
|
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.getOutlineControls = function () {
|
|
|
|
return this.outlineControlsWidget;
|
|
|
|
};
|
|
|
|
|
2022-07-06 07:48:55 +00:00
|
|
|
/**
|
|
|
|
* Get the list of pages on the stack ordered by appearance.
|
|
|
|
*
|
|
|
|
* @return {OO.ui.PageLayout[]}
|
|
|
|
*/
|
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.getPagesOrdered = function () {
|
|
|
|
return this.stackLayout.getItems();
|
|
|
|
};
|
|
|
|
|
2022-06-20 12:47:59 +00:00
|
|
|
/**
|
|
|
|
* Get a page by its symbolic name.
|
|
|
|
*
|
|
|
|
* @param {string} name Symbolic name of page
|
|
|
|
* @return {OO.ui.PageLayout|undefined} Page, if found
|
|
|
|
*/
|
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.getPage = function ( name ) {
|
|
|
|
return this.pages[ name ];
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return {OO.ui.PageLayout|undefined} Current page, if found
|
|
|
|
*/
|
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.getCurrentPage = function () {
|
|
|
|
var name = this.getCurrentPageName();
|
|
|
|
return name ? this.getPage( name ) : undefined;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the symbolic name of the current page.
|
|
|
|
*
|
|
|
|
* @return {string|null} Symbolic name of the current page
|
|
|
|
*/
|
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.getCurrentPageName = function () {
|
|
|
|
return this.currentPageName;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add pages to the booklet layout
|
|
|
|
*
|
|
|
|
* When pages are added with the same names as existing pages, the existing pages will be
|
|
|
|
* automatically removed before the new pages are added.
|
|
|
|
*
|
|
|
|
* @param {OO.ui.PageLayout[]} pages Pages to add
|
|
|
|
* @param {number} index Index of the insertion point
|
|
|
|
*/
|
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.addPages = function ( pages, index ) {
|
2022-06-23 14:47:51 +00:00
|
|
|
var i, name, page,
|
|
|
|
stackLayoutPages = this.stackLayout.getItems();
|
2022-06-20 12:47:59 +00:00
|
|
|
|
|
|
|
// Remove pages with same names
|
2022-06-23 14:47:51 +00:00
|
|
|
var remove = [];
|
|
|
|
for ( i = 0; i < pages.length; i++ ) {
|
2022-06-20 12:47:59 +00:00
|
|
|
page = pages[ i ];
|
|
|
|
name = page.getName();
|
|
|
|
|
|
|
|
if ( Object.prototype.hasOwnProperty.call( this.pages, name ) ) {
|
|
|
|
// Correct the insertion index
|
2022-06-23 14:47:51 +00:00
|
|
|
var currentIndex = stackLayoutPages.indexOf( this.pages[ name ] );
|
2022-06-20 12:47:59 +00:00
|
|
|
if ( currentIndex !== -1 && currentIndex + 1 < index ) {
|
|
|
|
index--;
|
|
|
|
}
|
|
|
|
remove.push( this.pages[ name ] );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( remove.length ) {
|
|
|
|
this.removePages( remove );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add new pages
|
2022-06-23 14:47:51 +00:00
|
|
|
for ( i = 0; i < pages.length; i++ ) {
|
2022-06-20 12:47:59 +00:00
|
|
|
page = pages[ i ];
|
|
|
|
name = page.getName();
|
|
|
|
this.pages[ page.getName() ] = page;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.stackLayout.addItems( pages, index );
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove the specified pages from the booklet layout.
|
|
|
|
*
|
|
|
|
* To remove all pages from the booklet, you may wish to use the #clearPages method instead.
|
|
|
|
*
|
2022-07-04 09:42:10 +00:00
|
|
|
* @param {OO.ui.PageLayout[]} pagesToRemove An array of pages to remove
|
2022-06-20 12:47:59 +00:00
|
|
|
*/
|
2022-07-04 09:42:10 +00:00
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.removePages = function ( pagesToRemove ) {
|
|
|
|
var layout = this,
|
2022-07-05 12:37:12 +00:00
|
|
|
isCurrentParameter = this.pages[ this.currentPageName ] instanceof ve.ui.MWParameterPage,
|
2022-07-04 09:42:10 +00:00
|
|
|
isCurrentPageRemoved = false,
|
|
|
|
prevSelectionCandidate, nextSelectionCandidate;
|
|
|
|
|
|
|
|
this.stackLayout.getItems().forEach( function ( page ) {
|
|
|
|
var pageName = page.getName();
|
|
|
|
if ( pagesToRemove.indexOf( page ) !== -1 ) {
|
|
|
|
delete layout.pages[ pageName ];
|
|
|
|
// If the current page is removed, clear currentPageName
|
|
|
|
if ( layout.currentPageName === pageName ) {
|
|
|
|
isCurrentPageRemoved = true;
|
|
|
|
}
|
|
|
|
} else {
|
2022-07-12 11:35:34 +00:00
|
|
|
// avoid choosing a parameter as previous selection
|
|
|
|
if ( !isCurrentPageRemoved && pageName.indexOf( '/' ) === -1 ) {
|
2022-07-04 09:42:10 +00:00
|
|
|
prevSelectionCandidate = pageName;
|
2022-07-12 11:35:34 +00:00
|
|
|
} else if ( isCurrentPageRemoved && !nextSelectionCandidate ) {
|
2022-07-04 09:42:10 +00:00
|
|
|
nextSelectionCandidate = pageName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
|
|
|
this.stackLayout.removeItems( pagesToRemove );
|
|
|
|
if ( isCurrentPageRemoved ) {
|
2022-07-05 12:37:12 +00:00
|
|
|
this.setPage( isCurrentParameter ? null :
|
|
|
|
nextSelectionCandidate || prevSelectionCandidate
|
|
|
|
);
|
2022-06-20 12:47:59 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clear all pages from the booklet layout.
|
|
|
|
*
|
|
|
|
* To remove only a subset of pages from the booklet, use the #removePages method.
|
|
|
|
*/
|
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.clearPages = function () {
|
|
|
|
this.pages = {};
|
|
|
|
this.currentPageName = null;
|
2022-06-24 13:23:43 +00:00
|
|
|
this.sidebar.clear();
|
2022-06-20 12:47:59 +00:00
|
|
|
this.stackLayout.clearItems();
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2022-07-05 12:37:12 +00:00
|
|
|
* Set the current page and sidebar selection, by symbolic name. Doesn't focus the input.
|
2022-06-20 12:47:59 +00:00
|
|
|
*
|
2022-07-05 12:37:12 +00:00
|
|
|
* @param {string} [name] Symbolic name of page. Omit to remove current selection.
|
2022-06-20 12:47:59 +00:00
|
|
|
*/
|
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.setPage = function ( name ) {
|
|
|
|
var page = this.pages[ name ];
|
2022-07-05 09:32:02 +00:00
|
|
|
|
2022-07-12 14:56:50 +00:00
|
|
|
if ( page && name === this.currentPageName ) {
|
|
|
|
return;
|
2022-06-20 12:47:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var previousPage = this.currentPageName ? this.pages[ this.currentPageName ] : null;
|
|
|
|
this.currentPageName = name;
|
|
|
|
|
|
|
|
if ( previousPage ) {
|
|
|
|
// Blur anything focused if the next page doesn't have anything focusable.
|
|
|
|
// This is not needed if the next page has something focusable (because once it is
|
2022-06-21 14:02:13 +00:00
|
|
|
// focused this blur happens automatically).
|
2022-06-23 09:00:15 +00:00
|
|
|
if ( !OO.ui.isMobile() &&
|
2022-07-12 11:43:24 +00:00
|
|
|
( !page || OO.ui.findFocusable( page.$element ).length !== 0 )
|
2022-06-20 12:47:59 +00:00
|
|
|
) {
|
2022-06-23 14:47:51 +00:00
|
|
|
var $focused = previousPage.$element.find( ':focus' );
|
2022-06-20 12:47:59 +00:00
|
|
|
if ( $focused.length ) {
|
|
|
|
$focused[ 0 ].blur();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-07-04 11:30:04 +00:00
|
|
|
this.sidebar.setSelectionByPageName( name );
|
2022-06-30 12:31:09 +00:00
|
|
|
this.refreshControls();
|
2022-06-20 12:47:59 +00:00
|
|
|
};
|
2022-06-27 14:46:08 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Refresh controls
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.refreshControls = function () {
|
2022-06-30 06:45:42 +00:00
|
|
|
var partId = this.sidebar.findSelectedPartId(),
|
|
|
|
pages = this.stackLayout.getItems(),
|
|
|
|
page = this.getPage( partId ),
|
2022-06-27 14:46:08 +00:00
|
|
|
index = pages.indexOf( page ),
|
2022-06-30 06:45:42 +00:00
|
|
|
isPart = !!partId,
|
2022-06-27 14:46:08 +00:00
|
|
|
canMoveUp, canMoveDown = false,
|
2022-06-30 06:45:42 +00:00
|
|
|
canBeDeleted = isPart;
|
2022-06-27 14:46:08 +00:00
|
|
|
|
|
|
|
/* check if this is the first element and no parameter */
|
2022-06-30 06:45:42 +00:00
|
|
|
canMoveUp = isPart && index > 0;
|
2022-06-27 14:46:08 +00:00
|
|
|
|
|
|
|
/* check if this is the last element and no parameter */
|
2022-06-30 06:45:42 +00:00
|
|
|
if ( isPart ) {
|
2022-06-27 14:46:08 +00:00
|
|
|
for ( var i = index + 1; i < pages.length; i++ ) {
|
|
|
|
if ( !( pages[ i ] instanceof ve.ui.MWParameterPage || pages[ i ] instanceof ve.ui.MWAddParameterPage ) ) {
|
|
|
|
canMoveDown = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this.outlineControlsWidget.setButtonsEnabled( {
|
|
|
|
canMoveUp: canMoveUp,
|
|
|
|
canMoveDown: canMoveDown,
|
|
|
|
canBeDeleted: canBeDeleted
|
|
|
|
} );
|
|
|
|
|
|
|
|
};
|