updated the edit description field, and the way that the card shows, and it stops the glitchy behaviour on topic editing

This commit is contained in:
Connor Turland 2013-01-05 12:50:19 -05:00
parent 1808d3f3df
commit a18ad58208
4 changed files with 43 additions and 9 deletions

Binary file not shown.

View file

@ -76,7 +76,7 @@ function graphSettings(type) {
tempNode2 = null;
tempInit = false;
}
else if (dragged != 0 && goRealtime) { saveLayout(dragged); }
else if (dragged != 0 && goRealtime) { saveLayout(dragged); }
},
onDragCancel: function() {
tempNode = null;
@ -94,6 +94,8 @@ function graphSettings(type) {
},
//Add also a click handler to nodes
onClick: function (node, eventInfo, e) {
console.log(e);
if (e.target.id != "infovis-canvas") return false;
//clicking on a node, or clicking on blank part of canvas?
if (node.nodeFrom) {
selectEdgeOnClickHandler(node);
@ -121,9 +123,14 @@ function graphSettings(type) {
var left = parseInt(style.left);
var top = parseInt(style.top);
var w = domElement.offsetWidth;
style.left = (left - w / 2) + 'px';
style.top = (top+25) + 'px';
style.left = (left - w / 2 + 107) + 'px';
//style.left = (left - w / 2) + 'px';
style.top = (top-165) + 'px';
style.display = '';
var label = document.getElementById('topic_' + node.id + '_label');
w = label.offsetWidth;
style = label.style;
style.left = (-(w / 2 + 106)) + 'px';
}
};
} else if (type = "centered") {
@ -222,6 +229,7 @@ function graphSettings(type) {
},
//Add also a click handler to nodes
onClick: function (node, eventInfo, e) {
if (e.target.id != "infovis-canvas") return false;
//clicking on an edge, a node, or clicking on blank part of canvas?
if (eventInfo.getEdge() != false || node.nodeFrom) {
if (eventInfo.getEdge() != false) selectEdgeOnClickHandler(eventInfo.getEdge());
@ -256,9 +264,14 @@ function graphSettings(type) {
var left = parseInt(style.left);
var top = parseInt(style.top);
var w = domElement.offsetWidth;
style.left = (left - w / 2) + 'px';
style.top = (top+25) + 'px';
style.left = (left - w / 2 + 107) + 'px';
//style.left = (left - w / 2) + 'px';
style.top = (top-165) + 'px';
style.display = '';
var label = document.getElementById('topic_' + node.id + '_label');
w = label.offsetWidth;
style = label.style;
style.left = (-(w / 2 + 106)) + 'px';
}
};
}
@ -568,7 +581,10 @@ function onCreateLabelHandler(domElement, node) {
data-object="topic" \
data-nil="$_desc_nil_$" \
data-attribute="desc" \
data-ok-button="Save" \
data-cancel-button="Discard" \
data-type="textarea">$_desc_$</span> \
<div class="clearfloat"></div> \
</div> \
</div> \
<a href="$_link_$" class="link" target="_blank"> \
@ -653,8 +669,10 @@ function onCreateLabelHandler(domElement, node) {
// Create a 'name' button and add it to the main node label
var nameContainer = document.createElement('span'),
style = nameContainer.style;
style = nameContainer.style;
nameContainer.className = 'name topic_' + node.id;
nameContainer.id = 'topic_' + node.id + '_label';
var littleHTML = ' \
<div class="label">$_name_$</div> \
<div class="nodeOptions">';

View file

@ -12,4 +12,6 @@
span.name {
cursor: pointer;
position: absolute;
top: 185px;
}

View file

@ -12,9 +12,6 @@
color:#FFF;
text-align: left;
overflow: visible;
position: relative;
top: -185px;
left: 107px;
z-index:14000;
}
@ -92,3 +89,20 @@
overflow: hidden;
text-overflow: ellipsis;
}
.best_in_place_desc {
width:160px;
height:200px;
display:block;
margin-top:2px;
}
.best_in_place_desc input {
float: right;
margin: 2px 0px 0px 2px;
padding: 1px 5px;
}
.best_in_place_desc input[value="Save"] {
margin-right: -8px;
}