[MediaWiki-commits] [Gerrit] mediawiki...ProofreadPage[master]: Reduce main edit box height when editin in vertical mode

2016-10-05 Thread Tpt (Code Review)
Tpt has submitted this change and it was merged.

Change subject: Reduce main edit box height when editin in vertical mode
..


Reduce main edit box height when editin in vertical mode

This change makes the main text box smaller so that it all can be
visible on the screen along with the image above it. Both are set
to the same height of one-third of the window height.

When switching back to the default horizonal mode, the image and
the text box are returned to their default sizes.

This also fixes a bug whereby the zoom initialization was setting
the image height too late, and so the image was displaying at full
height.

Bug: T145923
Change-Id: I6d2ec037f0633c413e3d225c2477e29f73200b36
---
M modules/page/ext.proofreadpage.page.edit.js
1 file changed, 12 insertions(+), 5 deletions(-)

Approvals:
  Tpt: Looks good to me, approved
  Samwilson: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/page/ext.proofreadpage.page.edit.js 
b/modules/page/ext.proofreadpage.page.edit.js
index c9cd2ee..720440b 100644
--- a/modules/page/ext.proofreadpage.page.edit.js
+++ b/modules/page/ext.proofreadpage.page.edit.js
@@ -65,7 +65,7 @@
 * Put the scan image on top or on the left of the edit area
 */
function toggleLayout() {
-   var $container;
+   var $container, newHeight;
if ( $zoomImage.data( 'prpZoom' ) ) {
$zoomImage.prpZoom( 'destroy' );
}
@@ -75,12 +75,15 @@
if ( isLayoutHorizontal ) {
$container.appendTo( $editForm.find( 
'.prp-page-container' ) );
 
+   // Switch CSS widths and heights back to the default 
side-by-size layout.
$container.css( {
-   width: ''
+   width: '',
+   height: ''
} );
$editForm.find( '.prp-page-content' ).css( {
width: ''
} );
+   $( '#wpTextbox1' ).css( { height: '' } );
ensureImageZoomInitialization();
 
isLayoutHorizontal = false;
@@ -88,6 +91,7 @@
} else {
$container.insertBefore( $editForm );
 
+   // Set the width and height of the image and form.
$container.css( {
width: '100%',
overflow: 'auto',
@@ -97,11 +101,14 @@
width: '100%'
} );
 
-   $container.css( {
-   height: $( window ).height() / 3 + 'px'
-   } );
+   // Turn on image zoom before setting the image height, 
or it'll be overridden.
ensureImageZoomInitialization();
 
+   // Set the image and the edit box to the same height 
(of 1/3 of the window each).
+   newHeight = $( window ).height() / 3 + 'px';
+   $container.css( { height: newHeight } );
+   $( '#wpTextbox1' ).css( { height: newHeight } );
+
isLayoutHorizontal = true;
}
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6d2ec037f0633c413e3d225c2477e29f73200b36
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: master
Gerrit-Owner: Samwilson 
Gerrit-Reviewer: Samwilson 
Gerrit-Reviewer: Tpt 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...ProofreadPage[master]: Reduce main edit box height when editin in vertical mode

2016-09-21 Thread Samwilson (Code Review)
Samwilson has uploaded a new change for review.

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

Change subject: Reduce main edit box height when editin in vertical mode
..

Reduce main edit box height when editin in vertical mode

This change makes the main text box smaller so that it all can be
visible on the screen along with the image above it. Both are set
to the same height of one-third of the window height.

When switching back to the default horizonal mode, the image and
the text box are returned to their default sizes.

This also fixes a bug whereby the zoom initialization was setting
the image height too late, and so the image was displaying at full
height.

Change-Id: I6d2ec037f0633c413e3d225c2477e29f73200b36
Task: T145923
---
M modules/page/ext.proofreadpage.page.edit.js
1 file changed, 10 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ProofreadPage 
refs/changes/29/311929/1

diff --git a/modules/page/ext.proofreadpage.page.edit.js 
b/modules/page/ext.proofreadpage.page.edit.js
index c9cd2ee..0249edd 100644
--- a/modules/page/ext.proofreadpage.page.edit.js
+++ b/modules/page/ext.proofreadpage.page.edit.js
@@ -75,12 +75,15 @@
if ( isLayoutHorizontal ) {
$container.appendTo( $editForm.find( 
'.prp-page-container' ) );
 
+   // Switch CSS widths and heights back to the default 
side-by-size layout.
$container.css( {
-   width: ''
+   width: '',
+   height: ''
} );
$editForm.find( '.prp-page-content' ).css( {
width: ''
} );
+   $("#wpTextbox1").css( { height: '' } );
ensureImageZoomInitialization();
 
isLayoutHorizontal = false;
@@ -88,6 +91,7 @@
} else {
$container.insertBefore( $editForm );
 
+   // Set the width and height of the image and form.
$container.css( {
width: '100%',
overflow: 'auto',
@@ -97,11 +101,13 @@
width: '100%'
} );
 
-   $container.css( {
-   height: $( window ).height() / 3 + 'px'
-   } );
+   // Turn on image zoom before setting the image height, 
or it'll be overridden.
ensureImageZoomInitialization();
 
+   // Set the image and the edit box to the same height 
(and 1/3 of the window each).
+   $container.css( { height: $( window ).height() / 3 + 
'px' } );
+   $("#wpTextbox1").css( { height: $container.css( 
"height" ) } );
+
isLayoutHorizontal = true;
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d2ec037f0633c413e3d225c2477e29f73200b36
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: master
Gerrit-Owner: Samwilson 

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