jenkins-bot has submitted this change and it was merged.

Change subject: MWMediaDialog: Make the dialog bigger when searching for media 
to insert
......................................................................


MWMediaDialog: Make the dialog bigger when searching for media to insert

Bug: T86397
Change-Id: I40e78441dd555dff837516220653b1c54bf5af92
---
M VisualEditor.php
M modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
A modules/ve-mw/ui/styles/widgets/ve.ui.MWMediaSearchWidget.css
M modules/ve-mw/ui/widgets/ve.ui.MWMediaSearchWidget.js
4 files changed, 20 insertions(+), 5 deletions(-)

Approvals:
  Mooeypoo: Looks good to me, approved
  Jforrester: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/VisualEditor.php b/VisualEditor.php
index a5be775..f3681dd 100644
--- a/VisualEditor.php
+++ b/VisualEditor.php
@@ -996,6 +996,7 @@
                ),
                'styles' => array(
                        
'modules/ve-mw/ui/styles/dialogs/ve.ui.MWMediaDialog.css',
+                       
'modules/ve-mw/ui/styles/widgets/ve.ui.MWMediaSearchWidget.css',
                        
'modules/ve-mw/ui/styles/widgets/ve.ui.MWMediaResultWidget.css',
                        
'modules/ve-mw/ui/styles/widgets/ve.ui.MWMediaInfoFieldWidget.css',
                ),
diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
index 5a25237..d6c7d0b 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
@@ -146,7 +146,8 @@
  * @inheritdoc
  */
 ve.ui.MWMediaDialog.prototype.getBodyHeight = function () {
-       return 400;
+       // FIXME: This should vary on panel.
+       return 500;
 };
 
 /**
@@ -200,7 +201,7 @@
        this.search = new ve.ui.MWMediaSearchWidget( {
                $: this.$,
                // Height of the panels
-               fullSize: 300
+               fullSize: 400
        } );
 
        this.$body.append( this.search.$spinner );
@@ -492,7 +493,7 @@
                fields = {},
                // Store clean API data
                apiData = {},
-               windowWidth = this.panels.$element.innerWidth(),
+               windowWidth = this.mediaImageInfoPanel.$element.innerWidth(),
                fileType = this.getFileType( imageinfo.url ),
                $thumbContainer = this.$( '<div>' )
                        .addClass( 've-ui-mwMediaDialog-panel-imageinfo-thumb' 
),
@@ -602,7 +603,7 @@
        );
        this.mediaImageInfoPanel.$element.append( this.$infoPanelWrapper );
        if ( isPortrait ) {
-               $info.outerWidth( Math.floor( 
this.mediaImageInfoPanel.$element.width() - $thumbContainer.width() - 1 ) );
+               $info.outerWidth( Math.floor( 
this.mediaImageInfoPanel.$element.innerWidth() - $thumbContainer.width() - 1 ) 
);
        }
 
        // Adjust height-limited fields
@@ -990,6 +991,7 @@
        var dialog = this;
        switch ( panel ) {
                case 'edit':
+                       this.setSize( 'large' );
                        // Set the edit panel
                        this.panels.setItem( this.bookletLayout );
                        // Focus the general settings page
@@ -1006,6 +1008,7 @@
                        this.mediaImageInfoPanel.$element.hide();
                        break;
                case 'search':
+                       this.setSize( 'larger' );
                        this.selectedImageInfo = null;
                        if ( !stopSearchRequery ) {
                                // Show a spinner while we check for file repos.
@@ -1049,6 +1052,7 @@
                        break;
                default:
                case 'imageInfo':
+                       this.setSize( 'larger' );
                        // Hide/show buttons
                        this.actions.setMode( 'info' );
                        // Hide/show the panels
diff --git a/modules/ve-mw/ui/styles/widgets/ve.ui.MWMediaSearchWidget.css 
b/modules/ve-mw/ui/styles/widgets/ve.ui.MWMediaSearchWidget.css
new file mode 100644
index 0000000..b3c2d5c
--- /dev/null
+++ b/modules/ve-mw/ui/styles/widgets/ve.ui.MWMediaSearchWidget.css
@@ -0,0 +1,10 @@
+/*!
+ * VisualEditor MediaWiki UserInterface MWMediaDialog styles.
+ *
+ * @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
+ * @license The MIT License (MIT); see LICENSE.txt
+ */
+
+.ve-ui-mwMediaSearchWidget .oo-ui-searchWidget-query .oo-ui-inputWidget {
+       max-width: 100em;
+}
diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWMediaSearchWidget.js 
b/modules/ve-mw/ui/widgets/ve.ui.MWMediaSearchWidget.js
index e9b5aba..f1fcf88 100644
--- a/modules/ve-mw/ui/widgets/ve.ui.MWMediaSearchWidget.js
+++ b/modules/ve-mw/ui/widgets/ve.ui.MWMediaSearchWidget.js
@@ -27,7 +27,7 @@
        // Properties
        this.sources = {};
        this.size = config.size || 200;
-       this.fullSize = config.fullSize || 400;
+       this.fullSize = config.fullSize || 500;
        this.$panels = config.$panels;
        this.queryTimeout = null;
        this.titles = {};

-- 
To view, visit https://gerrit.wikimedia.org/r/185575
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I40e78441dd555dff837516220653b1c54bf5af92
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Mooeypoo <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to