jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/367372 )

Change subject: Restrict query helper width
......................................................................


Restrict query helper width

In CSS, set a maximum width of 80% of the viewport width. This should
ensure that the splitter is always still in view, so the user can still
resize the query helper even if it’s very wide.

In JS, cap the minimum width we set for the query helper at 50% of the
viewport width. Being blocked from making the query helper any smaller
is fairly annoying, so this cap needs to be way below the 80% from CSS.

Change-Id: I24aef51030478a1b67710367c1f1167f2ca6e240
---
M style.css
M wikibase/queryService/ui/App.js
2 files changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Jonas Kress (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/style.css b/style.css
index 3b0d111..ed597a3 100644
--- a/style.css
+++ b/style.css
@@ -481,6 +481,7 @@
 .query-helper {
        flex: 0 0 auto;
        min-width: 300px;
+       max-width: 80vw;
        z-index: 100;
 }
 
diff --git a/wikibase/queryService/ui/App.js b/wikibase/queryService/ui/App.js
index 3336056..73bbf75 100644
--- a/wikibase/queryService/ui/App.js
+++ b/wikibase/queryService/ui/App.js
@@ -270,7 +270,10 @@
                if ( tableWidth > $queryHelper.width() ) {
                        $queryHelper.css(
                                'min-width',
-                               tableWidth + $tables.offset().left - 
$queryHelper.offset().left
+                               Math.min(
+                                       tableWidth + $tables.offset().left - 
$queryHelper.offset().left,
+                                       $( window ).width() * 0.5
+                               )
                        );
                }
        };

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I24aef51030478a1b67710367c1f1167f2ca6e240
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) <lucas.werkmeis...@wikimedia.de>
Gerrit-Reviewer: Jonas Kress (WMDE) <jonas.kr...@wikimedia.de>
Gerrit-Reviewer: Lucas Werkmeister (WMDE) <lucas.werkmeis...@wikimedia.de>
Gerrit-Reviewer: Smalyshev <smalys...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to