jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/336921 )
Change subject: Add a collapse button next to the close button
......................................................................
Add a collapse button next to the close button
* Makes the "close" button close the full screen dialog
* Makes the "collapse" button collapse the map details sidebar
Bug: T155350
Change-Id: Ic8bf7f0feea2d0a0fad49d88bd94077e9f6d49bd
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M modules/dialog-sidebar/sidebar.js
M styles/dialog.less
5 files changed, 32 insertions(+), 0 deletions(-)
Approvals:
Yurik: Looks good to me, approved
jenkins-bot: Verified
diff --git a/extension.json b/extension.json
index 66527a0..c4946ea 100644
--- a/extension.json
+++ b/extension.json
@@ -248,6 +248,7 @@
],
"messages": [
"kartographer-fullscreen-close",
+ "kartographer-fullscreen-collapse",
"kartographer-sidebar-coordinates",
"kartographer-sidebar-description",
"kartographer-sidebar-filterdropdown",
diff --git a/i18n/en.json b/i18n/en.json
index 016f501..bb11c5c 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -107,6 +107,7 @@
"mapbox-control-zoomin-title": "Zoom in",
"mapbox-control-zoomout-title": "Zoom out",
"kartographer-fullscreen-close": "Close",
+ "kartographer-fullscreen-collapse": "Hide map details",
"kartographer-fullscreen-text": "Show in full screen",
"visualeditor-mwmapsdialog-align": "Alignment",
"visualeditor-mwmapsdialog-geojson": "GeoJSON",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 2f6b323..40251d3 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -111,6 +111,7 @@
"mapbox-control-zoomin-title": "Title for map zoom in
button\n{{Identical|Zoom in}}",
"mapbox-control-zoomout-title": "Title for map zoom out
button\n{{Identical|Zoom out}}",
"kartographer-fullscreen-close": "Title of the fullscreen close
button\n{{Identical|Close}}",
+ "kartographer-fullscreen-collapse": "Title of the map details collapse
button",
"kartographer-fullscreen-text": "Tooltip for a button that puts the map
into full screen",
"visualeditor-mwmapsdialog-align": "Label for setting the map's
alignment\n{{Identical|Alignment}}",
"visualeditor-mwmapsdialog-geojson": "{{optional}}\nLabel for map
GeoJSON data",
diff --git a/modules/dialog-sidebar/sidebar.js
b/modules/dialog-sidebar/sidebar.js
index 5981bba..274f9fc 100644
--- a/modules/dialog-sidebar/sidebar.js
+++ b/modules/dialog-sidebar/sidebar.js
@@ -85,6 +85,7 @@
sidebar.mapPosition = map.getMapPosition( { scaled: true } );
sidebar.createCloseButton().$element.appendTo( $container );
+ sidebar.createCollapseButton().$element.appendTo( $container );
/**
* @property {jQuery}
@@ -286,6 +287,23 @@
title: mw.msg( 'kartographer-fullscreen-close'
),
framed: false,
classes: [
'mw-kartographer-mapDialog-closeButton' ]
+ } ).connect( this, { click:
sidebar.dialog.map.closeFullScreen.bind( sidebar.dialog.map ) } );
+ return button;
+ };
+
+ /**
+ * Creates a collapse button instance.
+ *
+ * @return {OO.ui.ButtonWidget}
+ */
+ SideBar.prototype.createCollapseButton = function () {
+ // Add close button to the sidebar
+ var sidebar = this,
+ button = new OO.ui.ButtonWidget( {
+ icon: 'expand',
+ title: mw.msg(
'kartographer-fullscreen-collapse' ),
+ framed: false,
+ classes: [
'mw-kartographer-mapDialog-collapseButton' ]
} ).connect( this, { click:
sidebar.dialog.toggleSideBar.bind( sidebar.dialog, false ) } );
return button;
};
diff --git a/styles/dialog.less b/styles/dialog.less
index fb67c62..16734dc 100644
--- a/styles/dialog.less
+++ b/styles/dialog.less
@@ -54,6 +54,17 @@
}
}
+ .mw-kartographer-mapDialog-collapseButton {
+ position: absolute;
+ top: 10px;
+ right: 44px;
+ margin-right: 0;
+
+ .oo-ui-buttonElement-button {
+ border: 0;
+ }
+ }
+
/* For MobileFrontend */
.skin-minerva & h2 {
margin-bottom: 0.6em;
--
To view, visit https://gerrit.wikimedia.org/r/336921
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic8bf7f0feea2d0a0fad49d88bd94077e9f6d49bd
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: JGirault <[email protected]>
Gerrit-Reviewer: JGirault <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: Yurik <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits