mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 14:33:59 +00:00
Follow-up I0a1a889: Show user uploads in gallery dialog
Gallery dialog should behave the same as media dialog. Bug: T62398 Change-Id: I601df9370b82868ba981e415fe24bd4f29399cdb
This commit is contained in:
parent
a9155f2d2b
commit
69d8a195e5
|
@ -839,8 +839,6 @@ ve.ui.MWGalleryDialog.prototype.onShowSearchPanelButtonClick = function () {
|
|||
* @param {boolean} visible The search panel is visible
|
||||
*/
|
||||
ve.ui.MWGalleryDialog.prototype.toggleSearchPanel = function ( visible ) {
|
||||
var pageTitle, namespace, namespacesWithSubpages;
|
||||
|
||||
visible = visible !== undefined ? visible : !this.searchPanelVisible;
|
||||
|
||||
// If currently visible panel is an edit panel, save the input values for the highlighted item
|
||||
|
@ -858,20 +856,8 @@ ve.ui.MWGalleryDialog.prototype.toggleSearchPanel = function ( visible ) {
|
|||
if ( !visible ) {
|
||||
this.highlightedCaptionTarget.focus();
|
||||
} else {
|
||||
if ( !this.searchWidget.getQuery().getValue() ) {
|
||||
// Wait until the search panel is visible before setting a default query
|
||||
// as this triggers a request and render.
|
||||
pageTitle = ve.init.target.getPageName( this.fragment.getDocument() );
|
||||
namespace = mw.config.get( 'wgNamespaceNumber' );
|
||||
namespacesWithSubpages = mw.config.get( 'wgVisualEditorConfig' ).namespacesWithSubpages;
|
||||
|
||||
if ( namespacesWithSubpages[ namespace ] ) {
|
||||
pageTitle = pageTitle.slice( pageTitle.lastIndexOf( '/' ) + 1 );
|
||||
}
|
||||
|
||||
this.searchWidget.getQuery().setValue( pageTitle );
|
||||
}
|
||||
|
||||
// Try to populate with user uploads
|
||||
this.searchWidget.queryMediaQueue();
|
||||
this.searchWidget.getQuery().focus().select();
|
||||
}
|
||||
this.updateDialogSize();
|
||||
|
|
Loading…
Reference in a new issue