[MediaWiki-commits] [Gerrit] Shorten text in option for preferred language. - change (apps...wikipedia)

2014-03-18 Thread Brion VIBBER (Code Review)
Brion VIBBER has submitted this change and it was merged.

Change subject: Shorten text in option for preferred language.
..


Shorten text in option for preferred language.

* Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=965913

Change-Id: I5b850f00cad129783ee2ef94775cfa2e7ee8fa56
---
M css/wikiapp.css
M js/lib/settings.js
2 files changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Brion VIBBER: Verified; Looks good to me, approved



diff --git a/css/wikiapp.css b/css/wikiapp.css
index c9faa80..eefd633 100644
--- a/css/wikiapp.css
+++ b/css/wikiapp.css
@@ -448,6 +448,7 @@
background-position: right;
background-size: 32px;
position: absolute;
+   overflow: hidden; /* Just in case the JS in seetings.js is off a bit */
top: 1.5em;
left: 1.5em;
right: 1em;
diff --git a/js/lib/settings.js b/js/lib/settings.js
index 7bd860d..7c4ef9c 100644
--- a/js/lib/settings.js
+++ b/js/lib/settings.js
@@ -95,11 +95,14 @@
// Adds a span containing the current select text to the dom.
// This is needed to mask the uglified FirefoxOS select element.
function setSelectText( $select ) {
+   var upperOptionTextWidth = Math.min(35, Math.floor( $( window 
).width() / 9));
$select.parent()
.append(
$( 'span /' )
.addClass( 'selectText' )
-   .text( $select.children( 
'option:selected' ).text() )
+   .text( $select.children( 
'option:selected' ).text().substring( 0, upperOptionTextWidth )
+   .concat($select.children( 
'option:selected' ).text().length  upperOptionTextWidth ? '...' : '')
+   )
).append(
$( 'br /' )
.css( 'clear', 'both' )

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5b850f00cad129783ee2ef94775cfa2e7ee8fa56
Gerrit-PatchSet: 1
Gerrit-Project: apps/firefox/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dr0ptp4kt ab...@wikimedia.org
Gerrit-Reviewer: Brion VIBBER br...@wikimedia.org
Gerrit-Reviewer: Dr0ptp4kt ab...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Shorten text in option for preferred language. - change (apps...wikipedia)

2014-02-24 Thread Dr0ptp4kt (Code Review)
Dr0ptp4kt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/115320

Change subject: Shorten text in option for preferred language.
..

Shorten text in option for preferred language.

* Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=965913

Change-Id: I5b850f00cad129783ee2ef94775cfa2e7ee8fa56
---
M css/wikiapp.css
M js/lib/settings.js
2 files changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/firefox/wikipedia 
refs/changes/20/115320/1

diff --git a/css/wikiapp.css b/css/wikiapp.css
index c9faa80..eefd633 100644
--- a/css/wikiapp.css
+++ b/css/wikiapp.css
@@ -448,6 +448,7 @@
background-position: right;
background-size: 32px;
position: absolute;
+   overflow: hidden; /* Just in case the JS in seetings.js is off a bit */
top: 1.5em;
left: 1.5em;
right: 1em;
diff --git a/js/lib/settings.js b/js/lib/settings.js
index 7bd860d..7c4ef9c 100644
--- a/js/lib/settings.js
+++ b/js/lib/settings.js
@@ -95,11 +95,14 @@
// Adds a span containing the current select text to the dom.
// This is needed to mask the uglified FirefoxOS select element.
function setSelectText( $select ) {
+   var upperOptionTextWidth = Math.min(35, Math.floor( $( window 
).width() / 9));
$select.parent()
.append(
$( 'span /' )
.addClass( 'selectText' )
-   .text( $select.children( 
'option:selected' ).text() )
+   .text( $select.children( 
'option:selected' ).text().substring( 0, upperOptionTextWidth )
+   .concat($select.children( 
'option:selected' ).text().length  upperOptionTextWidth ? '...' : '')
+   )
).append(
$( 'br /' )
.css( 'clear', 'both' )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b850f00cad129783ee2ef94775cfa2e7ee8fa56
Gerrit-PatchSet: 1
Gerrit-Project: apps/firefox/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dr0ptp4kt ab...@wikimedia.org

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