diff --git a/app/assets/images/go-arrow.png b/app/assets/images/go-arrow.png new file mode 100644 index 00000000..74181fe8 Binary files /dev/null and b/app/assets/images/go-arrow.png differ diff --git a/app/assets/javascripts/Jit/graphsettings.js b/app/assets/javascripts/Jit/graphsettings.js index 3f1c07a3..49b34535 100644 --- a/app/assets/javascripts/Jit/graphsettings.js +++ b/app/assets/javascripts/Jit/graphsettings.js @@ -528,6 +528,7 @@ function onCreateLabelHandler(domElement, node) { var html = ' \
\
$_name_$ \
- \
+ \
\
@@ -623,7 +624,7 @@ function onCreateLabelHandler(domElement, node) {
domElement.appendChild(showCard);
// add some events to the label
- showCard.onclick = function(){
+ $(showCard).find('a.close-link').click(function(){
delete node.selected;
node.setData('dim', 25, 'current');
node.eachAdjacency(function (adj) {
@@ -637,11 +638,11 @@ function onCreateLabelHandler(domElement, node) {
modes: ['edge-property:lineWidth:color'],
duration: 500
});
-// $('.showcard.topic_' + node.id).fadeOut('fast', function(){
-// $('.name').css('display','block');
-// Mconsole.plot();
-// });
- }
+ $('.showcard.topic_' + node.id).fadeOut('fast', function(){
+ $('.name').css('display','block');
+ Mconsole.plot();
+ });
+ });
// Create a 'name' button and add it to the main node label
var nameContainer = document.createElement('span'),
@@ -656,4 +657,14 @@ function onCreateLabelHandler(domElement, node) {
nameContainer.onclick = function(){
selectNodeOnClickHandler(node)
}
+
+ //bind callbacks
+ $(showCard).find('.type.best_in_place').bind("ajax:success", function() {
+ var metacode = $(this).html();
+ $(showCard).find('img.icon').attr('alt', metacode);
+ $(showCard).find('img.icon').attr('src', imgArray[metacode].src);
+
+ node.setData("metacode", metacode);
+ Mconsole.plot();
+ });
}//onCreateLabelHandler
diff --git a/app/assets/stylesheets/topics.css.scss b/app/assets/stylesheets/topics.css.scss
index 2d6af234..b672a538 100644
--- a/app/assets/stylesheets/topics.css.scss
+++ b/app/assets/stylesheets/topics.css.scss
@@ -4,7 +4,9 @@
.topic { display:block; float:left; position:relative; width:175px; height:300px; padding:10px 5px 10px 35px; background: url('bg.png'); border-radius:15px; margin:30px 0 30px 50px; color:#000; }
-.topic .delete {position: absolute;
+.close-link,
+.topic .delete {
+position: absolute;
top: -14px;
left: 0px;
background: none;