Commit 8f6cb0e9 by kevalbhatt

ATLAS-3620 : Beta UI : No option to create child tag by clicking the…

ATLAS-3620 : Beta UI : No option to create child tag by clicking the classificationPopover of parent tag.
parent 695480e9
...@@ -227,7 +227,7 @@ define([ ...@@ -227,7 +227,7 @@ define([
selector: '.classificationPopover', selector: '.classificationPopover',
content: function() { content: function() {
var type = $(this).data('detail'), var type = $(this).data('detail'),
liString = "<li><i class='fa fa-list-alt'></i><a href='javascript:void(0)' data-fn='onViewEdit'>View/Edit</a></li><li><i class='fa fa-trash-o'></i><a href='javascript:void(0)' data-fn='onDelete'>Delete</a></li><li><i class='fa fa-search'></i><a href='javascript:void(0)' data-fn='onSelectedSearch'>Search</a></li>" liString = " <li><i class='fa fa-plus'></i><a href='javascript:void(0)' data-fn='onClickCreateTag'>Create Sub-classification</a></li><li><i class='fa fa-list-alt'></i><a href='javascript:void(0)' data-fn='onViewEdit'>View/Edit</a></li><li><i class='fa fa-trash-o'></i><a href='javascript:void(0)' data-fn='onDelete'>Delete</a></li><li><i class='fa fa-search'></i><a href='javascript:void(0)' data-fn='onSelectedSearch'>Search</a></li>"
return "<ul>" + liString + "</ul>"; return "<ul>" + liString + "</ul>";
} }
} }
...@@ -585,20 +585,23 @@ define([ ...@@ -585,20 +585,23 @@ define([
var aTag = that.$("#" + str.node.a_attr.id), var aTag = that.$("#" + str.node.a_attr.id),
tagOffset = aTag.find(">.jstree-icon").offset(); tagOffset = aTag.find(">.jstree-icon").offset();
that.$(".tree-tooltip").removeClass("show"); that.$(".tree-tooltip").removeClass("show");
if (tagOffset.top && tagOffset.left) { setTimeout(function() {
aTag.find(">span.tree-tooltip").css({ if (aTag.hasClass("jstree-hovered") && tagOffset.top && tagOffset.left) {
top: "calc(" + tagOffset.top + "px - 45px)", aTag.find(">span.tree-tooltip").css({
left: "24px" top: "calc(" + tagOffset.top + "px - 45px)",
}).addClass("show"); left: "24px"
} }).addClass("show");
}
}, 1200);
}).on("dehover_node.jstree", function(nodes, str, res) { }).on("dehover_node.jstree", function(nodes, str, res) {
that.$(".tree-tooltip").removeClass("show"); that.$(".tree-tooltip").removeClass("show");
}); });
}, },
onClickCreateTag: function(e) {
onClickCreateTag: function(tagName) {
var that = this; var that = this;
require(["views/tag/CreateTagLayoutView", "modules/Modal"], function(CreateTagLayoutView, Modal) { require(["views/tag/CreateTagLayoutView", "modules/Modal"], function(CreateTagLayoutView, Modal) {
var view = new CreateTagLayoutView({ tagCollection: that.options.classificationDefCollection, enumDefCollection: enumDefCollection }), var view = new CreateTagLayoutView({ tagCollection: that.options.classificationDefCollection, enumDefCollection: enumDefCollection, selectedTag: tagName }),
modal = new Modal({ modal = new Modal({
title: "Create a new classification", title: "Create a new classification",
content: view, content: view,
...@@ -749,6 +752,12 @@ define([ ...@@ -749,6 +752,12 @@ define([
} }
}); });
}, },
onClickCreateTagClassification: function(e) {
var selectedNode = this.ui.classificationSearchTree.jstree("get_selected", true);
if (selectedNode && selectedNode[0]) {
this.onClickCreateTag(selectedNode[0].original.name);
}
},
onViewEditClassification: function() { onViewEditClassification: function() {
var selectedNode = this.ui.classificationSearchTree.jstree("get_selected", true); var selectedNode = this.ui.classificationSearchTree.jstree("get_selected", true);
if (selectedNode && selectedNode[0]) { if (selectedNode && selectedNode[0]) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment