Skip to content

Commit f60cbdd

Browse files
committed
classname fix
1 parent 7589206 commit f60cbdd

File tree

6 files changed

+17
-7
lines changed

6 files changed

+17
-7
lines changed

asset/app/js/canvas/nodecanvas_controller_base.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@ DesignerApp.module("NodeCanvas.Controller", function(Controller, DesignerApp, Ba
4545
DesignerApp.commands.setHandler("nodecanvas:create:relation", function(containerModel, targetId) {
4646

4747
var targetName = DesignerApp.NodeEntities.getNodeContainerFromNodeCid(targetId).get("name");
48+
var targetClass = DesignerApp.NodeEntities.getNodeContainerFromNodeCid(targetId).get("classname");
4849

4950
var view = new DesignerApp.NodeModule.Modal.CreateRelation({
5051
model: containerModel,
51-
target: targetName
52+
target: targetName,
53+
targetClass: targetClass
5254
});
5355

5456
var modal = DesignerApp.NodeModule.Modal.CreateTestModal(view);

asset/app/js/entities/node_entities.js

+6
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,12 @@ DesignerApp.module("NodeEntities", function(NodeEntities, DesignerApp, Backbone,
355355
raiseVent("rename");
356356
});
357357

358+
359+
//on our table rename update overlay
360+
relation.listenTo(sourceNodeContainer, "change:classname", function(targetNode) {
361+
raiseVent("rename");
362+
});
363+
358364
//on destroy clean up
359365
relation.on("destroy", function() {
360366
raiseVent("destroy");

asset/app/js/node/node_controller.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ DesignerApp.module("NodeModule", function(NodeModule, DesignerApp, Backbone, Mar
5151
var conn = param.dstRelation.get("conn");
5252
var label = conn.getOverlay("label");
5353

54-
label.setLabel(srcNodeContainer.get('name') + ' ' + dstRelationModel.get('relationtype') + ' ' + dstRelationModel.get('relatedmodel'));
54+
label.setLabel(srcNodeContainer.get('classname') + ' ' + dstRelationModel.get('relationtype') + ' ' + dstRelationModel.get('relatedmodel'));
5555
});
5656

5757
DesignerApp.vent.on("noderelation:destroy", function(param) {

asset/app/js/node/node_modal_relation.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ DesignerApp.module("NodeModule.Modal", function(Modal, DesignerApp, Backbone, Ma
44
initialize: function(param) {
55
this.listenTo(this, "formDataInvalid", this.formDataInvalid);
66
this.target = param.target;
7+
this.targetClass = param.targetClass;
8+
79
//console.log(param.target);
810
},
911
model: Node,
@@ -26,7 +28,7 @@ DesignerApp.module("NodeModule.Modal", function(Modal, DesignerApp, Backbone, Ma
2628
//
2729
//
2830
if (this.target) {
29-
templatevar.title = "Create Relation Between " + this.model.get('classname') + " and " + this.target;
31+
templatevar.title = "Create Relation Between " + this.model.get('classname') + " and " + this.targetClass;
3032
}
3133
//
3234
//

asset/app/js/node/node_view.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ DesignerApp.module("NodeModule.Views", function(Views, DesignerApp, Backbone, Ma
1616
}],
1717
["Label", {
1818
cssClass: "label",
19-
label: srcNodeContainer.get('name') + ' ' + dstRelationModel.get('relationtype') + ' ' + dstRelationModel.get('relatedmodel'),
19+
label: srcNodeContainer.get('classname') + ' - ' + dstRelationModel.get('relationtype') + ' ' + dstRelationModel.get('relatedmodel'),
2020
location: 0.3,
2121
id: "label"
2222
}]

index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@
248248
================================================== -->
249249
<script type="text/template" id="nodecontainer-template">
250250
<div>
251-
<p> <b>Table <%=name%> </b>
251+
<p> <b><%=name%>:<%=classname%></b>
252252
<a href="#" style="display: none;" class="btn relationadd btn-xs btn-container"><span class="glyphicon glyphicon-plus"></span> r</a>
253253
<a href="#" class="btn seeding btn-xs btn-container"><span class="glyphicon glyphicon-eye-open"></span> s</a>
254254
<a href="#" class="btn relation btn-xs btn-container"><span class="glyphicon glyphicon-eye-open"></span> r</a>
@@ -297,10 +297,10 @@
297297
<label class="col-md-4 control-label" for="container-color">Color</label>
298298
<div class="col-md-4">
299299
<select id="container-color" name="color" class="form-control">
300+
<option value="Grey">Grey</option>
300301
<option value="Red">Red</option>
301302
<option value="Green">Green</option>
302303
<option value="Blue">Blue</option>
303-
<option value="Grey">Grey</option>
304304
<option value="Yellow">Yellow</option>
305305
</select>
306306
</div>
@@ -429,7 +429,7 @@
429429
<!-- Template
430430
================================================== -->
431431
<script type="text/template" id="relationcollection-template">
432-
<legend>Relation List : <%=name%> </legend>
432+
<legend>Relation List Model: <%=classname%> </legend>
433433
<table class="table">
434434
<thead>
435435
<tr>

0 commit comments

Comments
 (0)