Amire80 has uploaded a new change for review.
https://gerrit.wikimedia.org/r/60880
Change subject: Add a caret for the ULS in the sidebar
......................................................................
Add a caret for the ULS in the sidebar
Change-Id: I6635092e9e020cb1f5b51f437abde4e81c31ae48
---
M resources/css/ext.uls.css
M resources/js/ext.uls.interface.js
2 files changed, 33 insertions(+), 0 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector
refs/changes/80/60880/1
diff --git a/resources/css/ext.uls.css b/resources/css/ext.uls.css
index fba7185..5e0bd33 100644
--- a/resources/css/ext.uls.css
+++ b/resources/css/ext.uls.css
@@ -52,6 +52,24 @@
cursor: pointer;
}
+.uls-menu .caret-before {
+ border-top: 20px solid transparent;
+ border-right: 20px solid #AAA;
+ border-bottom: 20px solid transparent;
+ display: inline-block;
+ left: -21px;
+ position: absolute;
+}
+
+.uls-menu .caret-after {
+ border-top: 20px solid transparent;
+ border-right: 20px solid #FCFCFC;
+ border-bottom: 20px solid transparent;
+ display: inline-block;
+ left: -20px;
+ position: absolute;
+}
+
#settings-block div.display-settings-block,
#settings-block div.input-settings-block {
display: inline-block;
diff --git a/resources/js/ext.uls.interface.js
b/resources/js/ext.uls.interface.js
index 3c9db38..1a27e42 100644
--- a/resources/js/ext.uls.interface.js
+++ b/resources/js/ext.uls.interface.js
@@ -151,6 +151,8 @@
ulsTop = this.$menu.offset().top,
ulsBottom = ulsTop + ulsHeight;
+ // If the ULS panel is out of the viewport,
scroll
+ // the window to show it
if ( ( ulsTop < windowScrollTop ) || (
ulsBottom > windowBottom ) ) {
if ( ulsHeight > windowHeight ) {
// Scroll to show as much of
the upper
@@ -164,6 +166,12 @@
scrollTop: scrollPosition
}, 500 );
}
+
+ // Set the position of the caret according to
the height
+ // of the top row of the menu
+ this.$menu.find( '.caret-before, .caret-after'
).css ( 'top',
+ this.$menu.find( '.row' ).height()
+ );
}
}
@@ -171,6 +179,13 @@
uls = $ulsTrigger.data( 'uls' );
+ if ( ulsPosition === 'interlanguage' ) {
+ uls.$menu.prepend(
+ $( '<span>' ).addClass( 'caret-before' ),
+ $( '<span>' ).addClass( 'caret-after' )
+ );
+ }
+
if ( !previousLang ) {
previousLanguages.push( currentLang );
mw.uls.setPreviousLanguages( previousLanguages );
--
To view, visit https://gerrit.wikimedia.org/r/60880
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6635092e9e020cb1f5b51f437abde4e81c31ae48
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Amire80 <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits