Skip to content

Commit

Permalink
Links remove notification
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitaeverywhere committed Apr 30, 2016
1 parent 9db2eb5 commit 101bd92
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "CacheClassExplorer",
"version": "1.16.2",
"version": "1.16.3",
"description": "Class Explorer for InterSystems Caché",
"directories": {
"test": "test"
Expand Down
7 changes: 7 additions & 0 deletions web/css/interface.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ html, body {
text-shadow: 1px 1px 0 white, -1px -1px 0 white, 1px -1px 0 white, -1px 1px 0 white;
}

#subLabel {
position: absolute;
font-size: initial;
font-style: initial;
font-weight: initial;
}

.central {
position: absolute;
left: 0;
Expand Down
1 change: 1 addition & 0 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<div class="ui-wrapTextOverflow">
<span id="className">Welcome!</span>
</div>
<div id="subLabel"></div>
</div>
<div class="ui-topRightToolBar">
<div id="button.showInfo" class="icon info"></div>
Expand Down
20 changes: 20 additions & 0 deletions web/js/CacheClassExplorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var CacheClassExplorer = function (treeViewContainer, classViewContainer) {
settingsView: id("settingsView"),
closeSettings: id("closeSettings"),
helpView: id("helpView"),
subLabel: id("subLabel"),
closeHelp: id("closeHelp"),
settingsExtraText: id("settingsExtraText"),
settings: {
Expand Down Expand Up @@ -174,6 +175,25 @@ CacheClassExplorer.prototype.updateNamespace = function () {

};

/**
* Sets the subLabel on the diagram.
* @param {string} [text]
* @param {string} [style]
*/
CacheClassExplorer.prototype.setSubLabel = function (text, style) {

if (!text) {
this.elements.subLabel.textContent = "";
this.elements.subLabel.setAttribute("style", "");
return;
}

this.elements.subLabel.innerHTML = text;
if (style)
this.elements.subLabel.setAttribute("style", style);

};

CacheClassExplorer.prototype.updateURL = function () {

var obj = {
Expand Down
8 changes: 8 additions & 0 deletions web/js/ClassView.js
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,7 @@ ClassView.prototype.confirmRender = function (data) {
// Don't ask me why. Just believe we need this peace of code.
this.zoom(null);
this.resetView();
this.cacheClassExplorer.setSubLabel();

if (!data["classes"]) {
console.error("Wrong data: no 'classes' property.", data);
Expand Down Expand Up @@ -820,6 +821,13 @@ ClassView.prototype.confirmRender = function (data) {
connector._toClass.instance = relFrom;
}
self.links.push(connector);
connector.on("all", function (e) {
if (e !== "remove") return;
self.cacheClassExplorer.setSubLabel(
"*Some links are removed on this diagram.",
"color:red"
);
});
}
}
}
Expand Down

0 comments on commit 101bd92

Please sign in to comment.