Skip to content

Commit 101bd92

Browse files
Links remove notification
1 parent 9db2eb5 commit 101bd92

File tree

5 files changed

+37
-1
lines changed

5 files changed

+37
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "CacheClassExplorer",
3-
"version": "1.16.2",
3+
"version": "1.16.3",
44
"description": "Class Explorer for InterSystems Caché",
55
"directories": {
66
"test": "test"

web/css/interface.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ html, body {
7171
text-shadow: 1px 1px 0 white, -1px -1px 0 white, 1px -1px 0 white, -1px 1px 0 white;
7272
}
7373

74+
#subLabel {
75+
position: absolute;
76+
font-size: initial;
77+
font-style: initial;
78+
font-weight: initial;
79+
}
80+
7481
.central {
7582
position: absolute;
7683
left: 0;

web/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<div class="ui-wrapTextOverflow">
5050
<span id="className">Welcome!</span>
5151
</div>
52+
<div id="subLabel"></div>
5253
</div>
5354
<div class="ui-topRightToolBar">
5455
<div id="button.showInfo" class="icon info"></div>

web/js/CacheClassExplorer.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ var CacheClassExplorer = function (treeViewContainer, classViewContainer) {
4747
settingsView: id("settingsView"),
4848
closeSettings: id("closeSettings"),
4949
helpView: id("helpView"),
50+
subLabel: id("subLabel"),
5051
closeHelp: id("closeHelp"),
5152
settingsExtraText: id("settingsExtraText"),
5253
settings: {
@@ -174,6 +175,25 @@ CacheClassExplorer.prototype.updateNamespace = function () {
174175

175176
};
176177

178+
/**
179+
* Sets the subLabel on the diagram.
180+
* @param {string} [text]
181+
* @param {string} [style]
182+
*/
183+
CacheClassExplorer.prototype.setSubLabel = function (text, style) {
184+
185+
if (!text) {
186+
this.elements.subLabel.textContent = "";
187+
this.elements.subLabel.setAttribute("style", "");
188+
return;
189+
}
190+
191+
this.elements.subLabel.innerHTML = text;
192+
if (style)
193+
this.elements.subLabel.setAttribute("style", style);
194+
195+
};
196+
177197
CacheClassExplorer.prototype.updateURL = function () {
178198

179199
var obj = {

web/js/ClassView.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,7 @@ ClassView.prototype.confirmRender = function (data) {
749749
// Don't ask me why. Just believe we need this peace of code.
750750
this.zoom(null);
751751
this.resetView();
752+
this.cacheClassExplorer.setSubLabel();
752753

753754
if (!data["classes"]) {
754755
console.error("Wrong data: no 'classes' property.", data);
@@ -820,6 +821,13 @@ ClassView.prototype.confirmRender = function (data) {
820821
connector._toClass.instance = relFrom;
821822
}
822823
self.links.push(connector);
824+
connector.on("all", function (e) {
825+
if (e !== "remove") return;
826+
self.cacheClassExplorer.setSubLabel(
827+
"*Some links are removed on this diagram.",
828+
"color:red"
829+
);
830+
});
823831
}
824832
}
825833
}

0 commit comments

Comments
 (0)