Gilles has uploaded a new change for review. https://gerrit.wikimedia.org/r/174116
Change subject: Bug fixes for "view terms" "view more" and the caption ellipsis ...................................................................... Bug fixes for "view terms" "view more" and the caption ellipsis This is a compilation of the following commits: 89efe125a41428a0645df1d6dacf5a02de0cea93 62d21f0d6783e8bf2b976c097ea6c550e32003f3 f5d77badef57acf1f6074c75f2d5d5736a77e881 Change-Id: Ief9aa1c7e982ee21030380551b956c6435d665e9 Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/987 Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/988 Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/985 --- M resources/mmv/ui/mmv.ui.metadataPanel.js M resources/mmv/ui/mmv.ui.permission.js M resources/mmv/ui/mmv.ui.truncatableTextField.less 3 files changed, 14 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer refs/changes/16/174116/1 diff --git a/resources/mmv/ui/mmv.ui.metadataPanel.js b/resources/mmv/ui/mmv.ui.metadataPanel.js index 793a6ff..82c5ab3 100644 --- a/resources/mmv/ui/mmv.ui.metadataPanel.js +++ b/resources/mmv/ui/mmv.ui.metadataPanel.js @@ -196,7 +196,7 @@ this.initializeCredit(); this.description = new mw.mmv.ui.Description( this.$imageMetadataLeft ); - this.permission = new mw.mmv.ui.Permission( this.$imageMetadataLeft ); + this.permission = new mw.mmv.ui.Permission( this.$imageMetadataLeft, this.scroller ); this.initializeImageLinks(); }; @@ -284,7 +284,7 @@ .hide() .on( 'click', function() { panel.permission.grow(); - panel.scroller.scrollIntoView( panel.permission.$box, 500 ); + panel.scroller.toggle( 'up' ); return false; } ); }; diff --git a/resources/mmv/ui/mmv.ui.permission.js b/resources/mmv/ui/mmv.ui.permission.js index 4e103a8..74919af 100644 --- a/resources/mmv/ui/mmv.ui.permission.js +++ b/resources/mmv/ui/mmv.ui.permission.js @@ -27,8 +27,9 @@ * @extends mw.mmv.ui.Element * @constructor * @param {jQuery} $container + * @param {mw.mmv.ui.MetadataPanelScroller} scroller */ - function Permission( $container ) { + function Permission( $container, scroller ) { var permission = this; mw.mmv.ui.Element.call( this, $container ); @@ -64,6 +65,7 @@ .on( 'click', '.mw-mmv-permission-text-viewmore', function( e ) { e.preventDefault(); permission.grow(); + permission.scroller.toggle( 'up' ); } ) ; @@ -99,6 +101,12 @@ permission.shrink(); } ) .appendTo( this.$box ); + + /** + * Panel scroller from the metadata panel object. + * @property {mw.mmv.ui.MetadataPanelScroller} + */ + this.scroller = scroller; } oo.inheritClass( Permission, mw.mmv.ui.Element ); P = Permission.prototype; diff --git a/resources/mmv/ui/mmv.ui.truncatableTextField.less b/resources/mmv/ui/mmv.ui.truncatableTextField.less index 0519319..fc401fd 100644 --- a/resources/mmv/ui/mmv.ui.truncatableTextField.less +++ b/resources/mmv/ui/mmv.ui.truncatableTextField.less @@ -1,3 +1,4 @@ +@import "mediawiki.mixins"; @import "../mmv.mixins"; .mw-mmv-ttf-container { @@ -41,6 +42,7 @@ background-repeat: no-repeat; /* @embed */ background-image: url(img/ellipsis_lightgray.svg); + .box-shadow( -4px 6px 0 0 white); // Hovering over .mw-mmv-ttf-ellipsis-container will make the ellipsis more visible to attract // attention to it. Since it has to be set on a parent element which is not under control of @@ -63,8 +65,7 @@ display: block; content: ''; - height: 1.2em; // 1em would not cover high glyphs - margin-top: -0.1em; // center + height: 1.6em; // 1em would not cover high glyphs width: @fade-length; margin-left: -@fade-length; -- To view, visit https://gerrit.wikimedia.org/r/174116 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ief9aa1c7e982ee21030380551b956c6435d665e9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MultimediaViewer Gerrit-Branch: wmf/1.25wmf8 Gerrit-Owner: Gilles <gdu...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits