diff --git a/app/assets/javascripts/Jit/graphsettings.js b/app/assets/javascripts/Jit/graphsettings.js
index ad3e679c..37ceedb5 100644
--- a/app/assets/javascripts/Jit/graphsettings.js
+++ b/app/assets/javascripts/Jit/graphsettings.js
@@ -116,7 +116,8 @@ function graphSettings(type) {
'
' +
'
' +
+ //'' + node.getData('desc') + '
' +
+ '' + node.getData('desc') + '.' + '
' +
'' + node.getData('link') + '';
var showCard = document.createElement('div');
showCard.className = 'showcard topic_' + node.id;
@@ -139,10 +140,10 @@ function graphSettings(type) {
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
@@ -298,7 +299,8 @@ function graphSettings(type) {
'
' +
'' +
+ //'' + node.getData('desc') + '
' +
+ '' + node.getData('desc') + '.' + '
' +
'' + node.getData('link') + '';
var showCard = document.createElement('div');
showCard.className = 'showcard topic_' + node.id;
@@ -322,10 +324,10 @@ function graphSettings(type) {
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();
+// });
}
}
@@ -623,4 +625,4 @@ function clickDragOnTopic(node, eventInfo, e) {
}
}
}
-}
\ No newline at end of file
+}
diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rb
index eef727a7..8253c3a5 100644
--- a/app/controllers/topics_controller.rb
+++ b/app/controllers/topics_controller.rb
@@ -124,18 +124,24 @@ class TopicsController < ApplicationController
@topic = Topic.find(params[:id]).authorize_to_edit(@current)
if @topic
- @topic.name = params[:topic][:name]
- @topic.desc = params[:topic][:desc]
- @topic.link = params[:topic][:link]
- @topic.permission = params[:topic][:permission]
- @topic.metacode = Metacode.find(params[:category][:metacode_id])
+ if params[:topic]
+ @topic.name = params[:topic][:name] if params[:topic][:name]
+ @topic.desc = params[:topic][:desc] if params[:topic][:desc]
+ @topic.link = params[:topic][:link] if params[:topic][:link]
+ @topic.permission = params[:topic][:permission] if params[:topic][:permission]
+ end
+ if params[:category]
+ @topic.metacode = Metacode.find(params[:category][:metacode_id]) if params[:category][:metacode_id]
+ end
@topic.save
- end
+ end
+
+ respond_with @topic
- respond_with(@user, location: topic_url(@topic)) do |format|
- end
+# respond_with(@user, location: topic_url(@topic)) do |format|
+# end
end
-
+
# DELETE topics/:id
def destroy
@current = current_user