From 7de1bf9d95d6c2ea629bb5c078b0c4aa6d73c11f Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 3 Aug 2017 23:04:39 +0100 Subject: [PATCH] Better node properties layout in diff table --- editor/js/ui/common/editableList.js | 4 ++- editor/js/ui/diff.js | 8 +++--- editor/sass/diff.scss | 43 +++++++++++++++++------------ red/api/locales/en-US/editor.json | 4 +-- 4 files changed, 35 insertions(+), 24 deletions(-) diff --git a/editor/js/ui/common/editableList.js b/editor/js/ui/common/editableList.js index 75a837682..8c8163c59 100644 --- a/editor/js/ui/common/editableList.js +++ b/editor/js/ui/common/editableList.js @@ -82,13 +82,15 @@ that.addItem({}); }); } + console.log(this.element.prop('id')); if (this.element.css("position") === "absolute") { ["top","left","bottom","right"].forEach(function(s) { var v = that.element.css(s); - if (s!=="auto" && s!=="") { + if (v!=="auto" && v!=="") { that.topContainer.css(s,v); that.uiContainer.css(s,"0"); that.element.css(s,'auto'); + console.log(s,v); } }) this.element.css("position","static"); diff --git a/editor/js/ui/diff.js b/editor/js/ui/diff.js index 813c79e77..db2e09427 100644 --- a/editor/js/ui/diff.js +++ b/editor/js/ui/diff.js @@ -19,8 +19,8 @@ RED.diff = (function() { } - function buildDiffPanel() { - var diffPanel = $('
    '); + function buildDiffPanel(container) { + var diffPanel = $('
      ').appendTo(container); var toolbar = $('
      '+ ' '+ @@ -1080,7 +1080,7 @@ RED.diff = (function() { }, open: function(tray) { var trayBody = tray.find('.editor-tray-body'); - var diffPanel = buildDiffPanel().appendTo(trayBody); + var diffPanel = buildDiffPanel(trayBody); if (remoteDiff) { $("#node-diff-view-diff-merge").show(); if (Object.keys(conflicts).length === 0) { @@ -1120,7 +1120,7 @@ RED.diff = (function() { if (remoteDiff !== undefined) { diffPanel.addClass('node-diff-three-way'); - $('
      ').i18n().appendTo("#node-dialog-view-diff-headers"); + $('
      ').i18n().appendTo("#node-dialog-view-diff-headers"); el.remoteTab = { n:{}, nodes:remoteDiff.newConfig.globals diff --git a/editor/sass/diff.scss b/editor/sass/diff.scss index 451f83250..4d9b72646 100644 --- a/editor/sass/diff.scss +++ b/editor/sass/diff.scss @@ -33,7 +33,6 @@ border: none; min-height: 0; } - } .red-ui-editableList-item-content { padding: 5px; @@ -42,19 +41,23 @@ } #node-dialog-view-diff-headers { position: absolute; - left:17px; - right:32px; + left:237px; + right:18px; top: 55px; height: 25px; - .node-diff-node-entry-cell:not(:first-child) { + div { + height: 25px; + display: inline-block; + box-sizing: border-box; + width: 50%; background: #f9f9f9; text-align: center; border-top: 1px solid $secondary-border-color; border-color:$secondary-border-color; + border-left: 1px solid $secondary-border-color; } - .node-diff-node-entry-cell:last-child { + div:last-child { border-right: 1px solid $secondary-border-color; - } } @@ -104,10 +107,10 @@ font-size: 0.9em; &:first-child { - border-top: 1px solid #eee; + border-top: 1px solid $secondary-border-color; } &:not(:last-child) { - border-bottom: 1px solid #eee; + border-bottom: 1px solid $secondary-border-color; } &.collapsed { @@ -130,10 +133,21 @@ table { border-collapse: collapse; table-layout:fixed; + width: calc(100% - 20px); + margin-left: 20px; + } + col:first-child { + width: 180px; + } + col:not(:first-child) { width: 100%; } td, th { - border: 1px solid $secondary-border-color; + border-top: 1px solid #f3f3f3; + border-left: 1px solid $secondary-border-color; + &:first-child { + border-left: none; + } padding: 0 0 0 3px; text-align: left; overflow-x: auto; @@ -149,12 +163,7 @@ } } - col:first-child { - width: 140px; - } - col:not(:first-child) { - width: 100%; - } + td { .node-diff-status { margin-left: 0; @@ -308,7 +317,7 @@ } } .node-diff-node-entry-properties { - margin: 5px ; + margin: 0; color: #666; } .node-diff-status { @@ -357,7 +366,7 @@ box-sizing: border-box; width: calc( (100% - 20px) / 2); height: 32px; - border-left: 1px solid #eee; + border-left: 1px solid $secondary-border-color; padding-top: 2px; white-space: nowrap; overflow: hidden; diff --git a/red/api/locales/en-US/editor.json b/red/api/locales/en-US/editor.json index 8ee3be8b2..dd2ed4efc 100644 --- a/red/api/locales/en-US/editor.json +++ b/red/api/locales/en-US/editor.json @@ -167,8 +167,8 @@ }, "nodeCount": "__count__ node", "nodeCount_plural": "__count__ nodes", - "local":"Local", - "remote":"Remote" + "local":"Local changes", + "remote":"Remote changes" }, "subflow": {