changeset 6130:59a38ec5ad8b

diff: tweak mergely side-by-side diff view Expand diff pane to match view port and avoid extra scroll bars.
author Mads Kiilerich <madski@unity3d.com>
date Fri, 12 Aug 2016 03:04:48 +0200
parents 8d11063e025d
children 6b723a49a9a1
files kallithea/public/css/style.css kallithea/templates/files/diff_2way.html
diffstat 2 files changed, 17 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/public/css/style.css	Fri Aug 12 03:04:48 2016 +0200
+++ b/kallithea/public/css/style.css	Fri Aug 12 03:04:48 2016 +0200
@@ -2953,6 +2953,17 @@
     padding: 2px 0px 0px 2px;
     float: left;
 }
+.diffblock.twoway {
+    overflow: visible;
+}
+.diffblock.twoway .diff-actions {
+    padding-top: 0;
+}
+.diffblock.twoway .diff-actions label input {
+    margin: -5px 5px 0 10px;
+    position: relative;
+    top: 3px;
+}
 .diffblock .diff-menu ul li {
     padding: 0px 0px 0px 0px !important;
 }
--- a/kallithea/templates/files/diff_2way.html	Fri Aug 12 03:04:48 2016 +0200
+++ b/kallithea/templates/files/diff_2way.html	Fri Aug 12 03:04:48 2016 +0200
@@ -31,8 +31,8 @@
         ${self.breadcrumbs()}
     </div>
 
-    <div class="diff-container" style="overflow-x: hidden">
-        <div class="diffblock comm" style="margin:3px; padding:1px">
+    <div class="diff-container">
+        <div class="diffblock comm twoway">
             <div class="code-header">
                 <div class="changeset_header">
                     <div class="changeset_file">
@@ -68,7 +68,7 @@
 $(document).ready(function () {
     $('#compare').mergely({
         width: 'auto',
-        height: '600',
+        height: $(window).height() - $('#compare').offset().top - $('#footer').height() - 35,
         fgcolor: {a:'#ddffdd',c:'#cccccc',d:'#ffdddd'},
         bgcolor: '#fff',
         viewport: true,
@@ -91,6 +91,9 @@
             }
         }
     });
+    // recompute width - avoids overflow and horizontal scrollbar
+    $('#compare').mergely('resize');
+
     $('#ignorews').change(function(e){
         var val = e.currentTarget.checked;
         $('#compare').mergely('options', {ignorews: val});