Skip to content

Commit daa8bba

Browse files
committed
Fix vertical sizing for diff pane in Air view. Show one more line of common text below the last edit.
1 parent 35659d4 commit daa8bba

5 files changed

Lines changed: 27 additions & 20 deletions

File tree

air/air_style.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.left {
2+
margin-right: 50%;
3+
float: none;
4+
}
5+
6+
.right {
7+
margin-left: 50%;
8+
float: none;
9+
}
10+
11+
.scroll {
12+
position: absolute;
13+
top: 0; right: 0; bottom: 0; left: 0;
14+
height: auto;
15+
}

air/diffCmd.html

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
<head>
44
<title>SourceDiff</title>
55
<link href="bootstrap.min.css" rel="stylesheet" type="text/css">
6-
<link href="style.css" rel="stylesheet" type="text/css">
6+
<link href="main_style.css" rel="stylesheet" type="text/css">
7+
<link href="air_style.css" rel="stylesheet" type="text/css">
78
<script src="AIRAliases.js" type="text/javascript"></script>
89
</head>
910
<body onload="appLoad()">
10-
<div class="wrapper">
11-
<div class="left">
12-
<h3>Original</h3>
13-
</div>
14-
<div class="right">
15-
<h3>Edit</h3>
16-
</div>
17-
</div>
11+
<!--<div class="wrapper">-->
12+
<!--<div class="left">-->
13+
<!--<h3>Original</h3>-->
14+
<!--</div>-->
15+
<!--<div class="right">-->
16+
<!--<h3>Edit</h3>-->
17+
<!--</div>-->
18+
<!--</div>-->
1819
<div class="wrapper">
1920
<div class="left scroll" id="scrollLeft">
2021
<pre id="original_result"></pre>
@@ -32,9 +33,6 @@ <h3>Edit</h3>
3233
function appLoad() {
3334
window.nativeWindow.maximize();
3435

35-
maximizeHeight(document.getElementById('scrollLeft'));
36-
maximizeHeight(document.getElementById('scrollRight'));
37-
3836
air.NativeApplication.nativeApplication.addEventListener(air.InvokeEvent.INVOKE, onInvoke);
3937

4038
var scrollLeft = document.getElementById('scrollLeft');
@@ -51,12 +49,6 @@ <h3>Edit</h3>
5149
});
5250
}
5351

54-
function maximizeHeight(element) {
55-
if (window.innerHeight) {
56-
element.style.height = (window.innerHeight - element.offsetTop - 10) + "px";
57-
}
58-
}
59-
6052
function onInvoke(event) {
6153
var original = readFile(event.currentDirectory, event.arguments[0]);
6254
var edit = readFile(event.currentDirectory, event.arguments[1]);

src/LineFormatter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ SourceDiff.LineFormatter = function(results, lineDiffs) {
9797

9898
var lastEdit = Math.max(lastDelete, lastAdd);
9999

100-
return Math.min(lines.length, lastEdit + 10);
100+
return Math.min(lines.length, lastEdit + 11);
101101
};
102102

103103
var getClassNameLeft = function (results, i) {

src/diff.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<title>Diff test</title>
55
<link href="../lib/bootstrap.min.css" rel="stylesheet" type="text/css">
6-
<link href="style.css" rel="stylesheet" type="text/css">
6+
<link href="main_style.css" rel="stylesheet" type="text/css">
77
</head>
88
<body>
99
<div class="wrapper">
File renamed without changes.

0 commit comments

Comments
 (0)