Skip to content

Commit 9fdb6ee

Browse files
Show compact view control
1 parent 36b854f commit 9fdb6ee

File tree

11 files changed

+62
-7
lines changed

11 files changed

+62
-7
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ represented in the table below.
5353

5454
| URL Parameter | Default | Description |
5555
|---|---|---|
56+
| `compact` | `false` | Hides interface controls when set to `true`. |
5657
| `host` | `http://hostname` | The host name of the server. |
5758
| `port` | `57772` | The port of the server. |
5859
| `webAppName` | `EntityBrowser` | Caché web application name. |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iknow-entity-browser",
3-
"version": "0.9.7",
3+
"version": "0.9.8",
44
"description": "Visualizer for iKnow entities",
55
"main": "gulpfile.babel.js",
66
"scripts": {
380 Bytes
Binary file not shown.

src/static/fonts/iknowentitybrowsericons.svg

Lines changed: 2 additions & 0 deletions
Loading
380 Bytes
Binary file not shown.
256 Bytes
Binary file not shown.

src/static/index.html

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,16 @@
3333
</div>
3434
</div>
3535
</div>
36-
<div id="rightTopIcons">
36+
<div id="rightTopExpandButton" class="rightTopIcons" style="opacity: 0">
37+
<div id="expandViewButton" class="ui icon-expand hint">
38+
<div class="tooltip">
39+
<div class="label">
40+
Show all controls
41+
</div>
42+
</div>
43+
</div>
44+
</div>
45+
<div id="rightTopIcons" class="rightTopIcons" style="opacity: 0">
3746
<div id="settingsToggle" class="ui icon-settings hint">
3847
<div class="tooltip">
3948
<div class="label">
@@ -48,8 +57,15 @@
4857
</div>
4958
</div>
5059
</a>
60+
<div id="collapseCompactViewButton" class="ui icon-collapse hint">
61+
<div class="tooltip">
62+
<div class="label">
63+
Collapse to compact view
64+
</div>
65+
</div>
66+
</div>
5167
</div>
52-
<div id="toolbarIcons">
68+
<div id="toolbarIcons" style="opacity: 0">
5369
<div id="undoButton" class="ui icon-undo hint">
5470
<div class="top tooltip">
5571
<div class="label">

src/static/js/settings/index.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import * as graph from "../graph";
33
import * as sourceSettings from "./sourceSettings";
44
import * as tabularViewSettings from "./tabularViewSettings";
55
import * as storage from "../storage";
6-
import { getChanges, applyChanges, init as initValues, applyFixedClasses } from "./values";
6+
import { getChanges, getOption, applyChanges, init as initValues, applyFixedClasses, setOption
7+
} from "./values";
78
import { makeAutosizable } from "../utils";
89

910
function toggleSettings (uiStateModel) {
@@ -40,4 +41,30 @@ export function init () {
4041
location.reload();
4142
});
4243

44+
updateCompactView();
45+
46+
}
47+
48+
function updateCompactView () {
49+
50+
let compact = !!getOption("compact");
51+
52+
function toggle (element, flag = true) {
53+
element.style.opacity = flag ? 1 : 0;
54+
element.style.pointerEvents = flag ? "all" : "none";
55+
}
56+
57+
toggle(document.getElementById("rightTopIcons"), !compact);
58+
toggle(document.getElementById("rightTopExpandButton"), compact);
59+
toggle(document.getElementById("toolbarIcons"), !compact);
60+
61+
document.getElementById("expandViewButton").addEventListener("click", () => {
62+
setOption("compact", false);
63+
updateCompactView();
64+
});
65+
document.getElementById("collapseCompactViewButton").addEventListener("click", () => {
66+
setOption("compact", true);
67+
updateCompactView();
68+
});
69+
4370
}

src/static/js/settings/values.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as url from "../url";
55
const STORAGE_KEY = "settings";
66

77
const settingsTypes = {
8+
compact: Boolean,
89
host: String,
910
port: Number,
1011
webAppName: String,
@@ -16,7 +17,9 @@ const settingsTypes = {
1617
tabularShowHiddenNodes: Boolean
1718
};
1819

19-
const settings = { // assign defaults here
20+
// defaults are assigned here
21+
const settings = {
22+
compact: false,
2023
host: "",
2124
port: 57772,
2225
webAppName: "EntityBrowser",

src/static/scss/icons.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,9 @@
118118
.icon-question:before {
119119
content: "\7a";
120120
}
121+
.icon-expand:before {
122+
content: "\41";
123+
}
124+
.icon-collapse:before {
125+
content: "\42";
126+
}

0 commit comments

Comments
 (0)