Skip to content

Commit ed4e573

Browse files
save file
1 parent 9ebcf96 commit ed4e573

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

utils/editors/text-diff/v2.0/text-diff-v2.0.html

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,10 @@
198198
{display:flex;flex:1;margin:5px 0;gap:10px}
199199

200200
#view1
201-
{flex:1;display:flex;flex-direction:column;border:1px solid var(--green);padding:5px}
201+
{flex:1;display:flex;flex-direction:column;border:1px solid var(--green);padding:5px;box-sizing:border-box}
202202

203203
#view2
204-
{flex:1;display:flex;flex-direction:column;border:1px solid var(--red);padding:5px}
204+
{flex:1;display:flex;flex-direction:column;border:1px solid var(--red);padding:5px;box-sizing:border-box}
205205

206206

207207
#hdr
@@ -214,7 +214,7 @@
214214
{flex:1}
215215

216216
#output
217-
{border:1px solid lightgray;padding:5px}
217+
{border:1px solid lightgray;padding:5px;box-sizing:border-box}
218218

219219
/*
220220
#output-hldr
@@ -254,7 +254,7 @@
254254
<file-mod id=file1 component></file-mod>
255255
<div id=label>primary</div>
256256
</div>
257-
<web-editor id=editor1 component></web-editor>
257+
<web-editor id=editor1 component mode=text></web-editor>
258258
</div>
259259

260260
<div id=slider-1 style='width:10px;cursor:ew-resize'></div>
@@ -264,13 +264,14 @@
264264
<file-mod id=file2 component></file-mod>
265265
<div id=label>secondary</div>
266266
</div>
267-
<web-editor id=editor2 component></web-editor>
267+
<web-editor id=editor2 component mode=text></web-editor>
268268
</div>
269269
</div>
270270

271+
<div id=slider-2 style='height:10px;cursor:ns-resize'></div>
271272

272273

273-
<web-editor id=output component></web-editor>
274+
<web-editor id=output component mode=text></web-editor>
274275
<!--
275276
<div id=output-hldr>
276277
<web-editor id=output component></web-editor>
@@ -294,6 +295,7 @@
294295

295296

296297
var slider1 = {mode:'vert'};
298+
var slider2 = {mode:'horiz'};
297299

298300
var ui = {};
299301
ui.mode = 'vert';
@@ -319,21 +321,30 @@
319321
$('#output-hdr [type=checkbox]').onclick = btn['output-chk'];
320322
$('[value=check]').onclick = btn.check;
321323

322-
323324

324325
var view1 = $('#view1');
325326
primary.filemod.initdom(view1);
326-
primary.editor.initdom(view1,{mode:'text'});
327+
primary.editor.initdom();
327328

328329
var view2 = $('#view2');
329330
secondary.filemod.initdom(view2);
330-
secondary.editor.initdom(view2,{mode:'text'});
331+
secondary.editor.initdom();
332+
var w = view2.offsetWidth;
333+
view2.style.flex = 'none';
334+
view2.style.width = w+'px';
335+
331336

332337
var node = $('#output');
333-
await output.initdom(node,{mode:'text'});
338+
output.initdom();
339+
setTimeout(()=>{
340+
var w = node.offsetHeight;console.log('w',w);
341+
node.style.flex = 'none';
342+
node.style.height = w+'px';
343+
},500);
344+
334345

335-
//slider1.root = $('#main');
336346
slider1.node = $.slider('#view1','#slider-1','#view2',null,slider1);
347+
slider2.node = $.slider('#main','#slider-2','#output',null,slider2);
337348

338349

339350

0 commit comments

Comments
 (0)