Commit 848c799e by kevalbhatt Committed by Sarath Subramanian

ATLAS-3484:Beta UI: Add more resize flexibility for sidebar

parent c88ea511
......@@ -222,11 +222,14 @@ td {
}
&.searchTableName {
min-width: 150px;
&:hover {
img {
transform: scale(1.5);
transform-origin: 100% 50%;
transition: transform 0.2s;
outline-color: #f5f5f5;
}
}
......@@ -241,6 +244,8 @@ td {
height: 20px;
margin: 0px 5px;
float: left;
outline: 1px #fff solid;
outline-offset: -1px;
}
}
}
\ No newline at end of file
......@@ -202,4 +202,22 @@ define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jq
return this;
}
});
var HeaderDecodeCell = Backgrid.HeaderHTMLDecodeCell = Backgrid.HeaderCell.extend({
initialize: function(options) {
Backgrid.HeaderCell.prototype.initialize.apply(this, arguments);
this.name = _.unescape(this.column.get("name"))
// Add class
this.$el.addClass(this.name);
},
render: function() {
this.$el.empty();
// Add to header
this.$el.text(this.name);
this.delegateEvents();
return this;
}
});
});
\ No newline at end of file
......@@ -496,7 +496,7 @@ define(['require',
},
getContainer: function(object) {
var value = object.value,
entityLabel = this.capitalize(value.name);
entityLabel = this.capitalize(_.escape(value.name));
return '<div class=" row ' + value.isOptional + '"><span class="col-sm-3">' +
'<label><span class="' + (value.isOptional ? 'true' : 'false required') + '">' + entityLabel + '</span><span class="center-block ellipsis-with-margin text-gray" title="Data Type : ' + value.typeName + '">' + '(' + Utils.escapeHtml(value.typeName) + ')' + '</span></label></span>' +
......
......@@ -800,8 +800,9 @@ define(['require',
return;
}
col[obj.name] = {
label: obj.name.capitalize(),
label: _.escape(obj.name).capitalize(),
cell: "Html",
headerCell: Backgrid.HeaderHTMLDecodeCell,
editable: false,
resizeable: true,
orderable: true,
......
......@@ -20,13 +20,13 @@
}
#sidebar-wrapper {
z-index: 1000;
z-index: 2;
position: fixed;
/*left: 350px;*/
/*width: 0;*/
height: 100%;
/*margin-left: -350px;*/
overflow-y: auto;
/*overflow-y: auto;*/
background: #fff;
-moz-transition: left 0.3s;
-o-transition: left 0.3s;
......
......@@ -24,6 +24,7 @@
&.panel-default>.panel-heading {
border-color: $color_mystic_approx;
border-width: 2px;
min-width: 222px;
button {
height: inherit;
......@@ -77,8 +78,6 @@
overflow: auto;
height: calc(100vh - 188px);
.panel-collapse {
padding-top: 7px;
}
......@@ -95,7 +94,7 @@
.jstree-default .jstree-node {
position: relative;
max-width: 300px;
max-width: 100%;
}
.tag-tree>li.parent-node>div:hover {
......@@ -278,8 +277,6 @@
color: $action_gray;
}
}
}
.sidebar-content {
......@@ -333,17 +330,18 @@
.slider-bar {
position: absolute;
right: 6px;
right: 0px;
height: 100%;
width: 9px;
width: 13px;
cursor: col-resize;
z-index: 999;
background: $white;
.line {
position: absolute;
height: 100%;
background: $color_mystic_approx;
left: 1px;
left: -2px;
width: 2px;
}
......@@ -366,7 +364,7 @@
background-color: $white;
position: absolute;
color: $color_havelock_blue_approx;
right: -6px;
right: 0px;
border-radius: 16px;
display: none;
top: 9px;
......@@ -379,3 +377,22 @@
}
}
}
span.tree-tooltip {
position: fixed;
display: none;
top: calc(346px - 39px);
left: 138px;
z-index: 1004;
background: #f9f9f9;
color: #2c2c2c;
padding: 5px;
height: 36px;
box-shadow: 0px 0px 3px 0px #8080806b;
border: 1px solid #80808057;
border-radius: 9px;
&.show {
display: block;
}
}
\ No newline at end of file
......@@ -216,11 +216,14 @@ td {
}
&.searchTableName {
min-width: 150px;
&:hover {
img {
transform: scale(1.5);
transform-origin: 100% 50%;
transition: transform 0.2s;
outline-color: #f5f5f5;
}
}
......@@ -235,6 +238,8 @@ td {
height: 20px;
margin: 0px 5px;
float: left;
outline: 1px #fff solid;
outline-offset: -1px;
}
}
}
\ No newline at end of file
......@@ -33,6 +33,8 @@ body {
}
#page-wrapper {
height: calc(100vh - 90px);
overflow: auto;
padding-top: 15px !important;
padding-bottom: 10px !important;
}
......@@ -72,7 +74,6 @@ body {
&:hover {
color: $gray;
}
}
.atlas-page-header {
......@@ -210,7 +211,6 @@ header.atlas-header {
}
}
td {
padding: 0px 15px;
......@@ -227,7 +227,6 @@ header.atlas-header {
font-size: 18px;
}
}
}
}
}
......@@ -688,12 +687,10 @@ hr[size="10"] {
box-shadow: 0px 0px 3px 0px #8080806b;
}
.tooltip.bottom .tooltip-arrow {
border-bottom-color: #000;
}
td.searchTableName:hover {
.isIncomplete {
&.show.search-result-page {
......@@ -718,7 +715,7 @@ td.searchTableName:hover {
.isIncomplete {
&.show {
img {
opacity: .2;
opacity: 0.2;
//animation: blink 2.5s infinite;
}
......@@ -735,7 +732,6 @@ td.searchTableName:hover {
}
}
foreignObject {
display: block;
......@@ -759,9 +755,7 @@ td.searchTableName:hover {
font-size: 9px;
top: 5px;
}
}
}
foreignObject {
......
......@@ -78,6 +78,7 @@ define(['require',
} else if (isPopOverEl.$tip) {
$('.popover').not(isPopOverEl.$tip).popover('hide');
}
$(".tree-tooltip").removeClass("show");
$(".tooltip").tooltip("hide");
}
});
......
......@@ -202,4 +202,22 @@ define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jq
return this;
}
});
var HeaderDecodeCell = Backgrid.HeaderHTMLDecodeCell = Backgrid.HeaderCell.extend({
initialize: function(options) {
Backgrid.HeaderCell.prototype.initialize.apply(this, arguments);
this.name = _.unescape(this.column.get("name"))
// Add class
this.$el.addClass(this.name);
},
render: function() {
this.$el.empty();
// Add to header
this.$el.text(this.name);
this.delegateEvents();
return this;
}
});
});
\ No newline at end of file
......@@ -498,7 +498,7 @@ define(['require',
},
getContainer: function(object) {
var value = object.value,
entityLabel = this.capitalize(value.name);
entityLabel = this.capitalize(_.escape(value.name));
return '<div class=" row ' + value.isOptional + '"><span class="col-sm-3">' +
'<label><span class="' + (value.isOptional ? 'true' : 'false required') + '">' + entityLabel + '</span><span class="center-block ellipsis-with-margin text-gray" title="Data Type : ' + value.typeName + '">' + '(' + Utils.escapeHtml(value.typeName) + ')' + '</span></label></span>' +
......
......@@ -58,6 +58,7 @@ define([
e.stopPropagation();
$("#sidebar-wrapper,#page-wrapper").addClass("animate-me");
$(".container-fluid.view-container").toggleClass("slide-in");
$("#page-wrapper>div").css({ width: "auto" });
$("#sidebar-wrapper,.search-browse-box,#page-wrapper").removeAttr("style");
setTimeout(function() {
$("#sidebar-wrapper,#page-wrapper").removeClass("animate-me");
......@@ -122,7 +123,6 @@ define([
this.renderClassificationTree();
this.renderGlossaryTree();
this.renderCustomFilterTree();
// this.renderSaveSearch();
this.showHideGlobalFilter();
this.showDefaultPage();
},
......@@ -143,16 +143,25 @@ define([
onShow: function() {
var that = this;
this.$(".search-browse-box").resizable({
handles: { 'e': '.slider-bar' },
minWidth: 224,
maxWidth: 360,
handles: { "e": ".slider-bar" },
minWidth: 30,
minHeight: window.screen.height,
resize: function(event, ui) {
var width = ui.size.width,
calcWidth = "calc(100% - " + width + "px)";
$("#sidebar-wrapper").width(width);
$("#page-wrapper").css({ "width": calcWidth, marginLeft: width + "px" });
$("#page-wrapper").css({ width: calcWidth, marginLeft: width + "px" });
var selectedEl = $("#page-wrapper>div");
if (width > 700) {
$("#page-wrapper").css({ overflowX: "auto" });
selectedEl.css({ width: window.screen.width - 360 });
} else {
$("#page-wrapper").css({ overflow: "none" });
selectedEl.css({ width: "100%" });
}
},
start: function() {
$(".searchLayoutView").removeClass("open");
this.expanding = $(".container-fluid.view-container").hasClass("slide-in");
$(".container-fluid.view-container").removeClass("slide-in");
if (this.expanding) {
......@@ -160,7 +169,7 @@ define([
}
},
stop: function(event, ui) {
if (!this.expanding && ui.size.width < 225) {
if (!this.expanding && ui.size.width <= 30) {
$("#sidebar-wrapper,#page-wrapper").addClass("animate-me");
$("#sidebar-wrapper,#page-wrapper,.search-browse-box").removeAttr("style");
$(".container-fluid.view-container").addClass("slide-in");
......@@ -169,7 +178,7 @@ define([
$("#sidebar-wrapper,#page-wrapper").removeClass("animate-me");
}, 301);
}
})
});
},
showHideGlobalFilter: function() {
if (this.options.fromDefaultSearch) {
......@@ -178,92 +187,6 @@ define([
this.$(".mainContainer").addClass("global-filter-browser");
}
},
// renderSaveSearch: function() {
// var that = this;
// require(["views/search/save/SaveSearchView"], function(SaveSearchView) {
// var saveSearchBaiscCollection = new VSearchList(),
// saveSearchAdvanceCollection = new VSearchList(),
// saveSearchCollection = new VSearchList();
// saveSearchCollection.url = UrlLinks.saveSearchApiUrl();
// saveSearchBaiscCollection.fullCollection.comparator = function(model) {
// return getModelName(model);
// };
// saveSearchAdvanceCollection.fullCollection.comparator = function(model) {
// return getModelName(model);
// };
// var obj = {
// value: that.options.value,
// searchVent: that.searchVent,
// typeHeaders: that.typeHeaders,
// fetchCollection: fetchSaveSearchCollection,
// classificationDefCollection: that.classificationDefCollection,
// entityDefCollection: that.entityDefCollection,
// getValue: function() {
// var queryObj = that.query[that.type],
// entityObj = that.searchTableFilters["entityFilters"],
// tagObj = that.searchTableFilters["tagFilters"],
// urlObj = Utils.getUrlState.getQueryParams();
// if (urlObj) {
// // includeDE value in because we need to send "true","false" to the server.
// urlObj.includeDE = urlObj.includeDE == "true" ? true : false;
// urlObj.excludeSC = urlObj.excludeSC == "true" ? true : false;
// urlObj.excludeST = urlObj.excludeST == "true" ? true : false;
// }
// return _.extend({}, queryObj, urlObj, {
// entityFilters: entityObj ? entityObj[queryObj.type] : null,
// tagFilters: tagObj ? tagObj[queryObj.tag] : null,
// type: queryObj.type,
// query: queryObj.query,
// term: queryObj.term,
// tag: queryObj.tag
// });
// },
// applyValue: function(model, searchType) {
// that.manualRender(
// _.extend(
// searchType,
// CommonViewFunction.generateUrlFromSaveSearchObject({
// value: { searchParameters: model.get("searchParameters"), uiParameters: model.get("uiParameters") },
// classificationDefCollection: that.classificationDefCollection,
// entityDefCollection: that.entityDefCollection
// })
// )
// );
// }
// };
// // will be shown as different tab on the screen.
// that.RSaveSearchBasic.show(
// new SaveSearchView(
// _.extend(obj, {
// isBasic: true,
// displayButtons: false,
// collection: saveSearchBaiscCollection.fullCollection
// })
// )
// );
// // that.RSaveSearchAdvance.show(new SaveSearchView(_.extend(obj, {
// // isBasic: false,
// // collection: saveSearchAdvanceCollection.fullCollection
// // })));
// function getModelName(model) {
// if (model.get('name')) {
// return model.get('name').toLowerCase();
// }
// }
// function fetchSaveSearchCollection() {
// saveSearchCollection.fetch({
// success: function(collection, data) {
// saveSearchAdvanceCollection.fullCollection.reset(_.where(data, { searchType: "ADVANCED" }));
// saveSearchBaiscCollection.fullCollection.reset(_.where(data, { searchType: "BASIC" }));
// },
// silent: true
// });
// }
// fetchSaveSearchCollection();
// });
// },
manualRender: function(options) {
var that = this;
if (options) {
......
......@@ -812,8 +812,9 @@ define(['require',
return;
}
col[obj.name] = {
label: obj.name.capitalize(),
label: _.escape(obj.name).capitalize(),
cell: "Html",
headerCell: Backgrid.HeaderHTMLDecodeCell,
editable: false,
resizeable: true,
orderable: true,
......
......@@ -38,7 +38,7 @@ define(['require',
},
templateHelpers: function() {
return {
selectedModel: this.selectedModel ? this.selectedModel : null
selectedModel: this.selectedModel ? this.selectedModel.toJSON() : null
};
},
events: function() {
......@@ -48,12 +48,6 @@ define(['require',
initialize: function(options) {
var that = this;
_.extend(this, _.pick(options, 'selectedModel', 'collection', 'getValue', 'isBasic', 'saveObj'));
if (this.selectedModel) {
var modelDetail = this.selectedModel.toJSON();
modelDetail.name = _.unescape(modelDetail.name);
this.selectedModel = modelDetail;
}
this.model = new VSearch();
if (this.saveObj) {
this.onCreateButton();
......@@ -87,10 +81,10 @@ define(['require',
},
onCreateButton: function(modal) {
var that = this,
obj = { name: this.ui.saveAsName.val ? _.escape(this.ui.saveAsName.val()) : null };
obj = { name: this.ui.saveAsName.val ? this.ui.saveAsName.val() : null };
if (this.selectedModel) {
// Update Name only.
var saveObj = this.selectedModel;
var saveObj = this.selectedModel.toJSON();
saveObj.name = obj.name;
} else {
obj.value = this.getValue();
......@@ -116,12 +110,12 @@ define(['require',
collectionRef.set(data);
}
Utils.notifySuccess({
content: _.unescape(obj.name) + Messages.editSuccessMessage
content: obj.name + Messages.editSuccessMessage
});
} else {
that.collection.add(data);
Utils.notifySuccess({
content: _.unescape(obj.name) + Messages.addSuccessMessage
content: obj.name + Messages.addSuccessMessage
});
}
}
......
......@@ -83,9 +83,7 @@ define([
var type = $(e.currentTarget).data("type");
e.stopPropagation();
this.isGroupView = !this.isGroupView;
// this.ui.groupOrFlatTree.attr("data-original-title", (this.isGroupView ? "Show flat tree" : "Show group tree"));
this.ui.groupOrFlatTree.tooltip('hide');
// this.ui.groupOrFlatTree.find("i").toggleClass("group-tree-deactivate");
this.ui.groupOrFlatTree.find("i").toggleClass("fa-sitemap fa-list-ul");
this.ui.groupOrFlatTree.find("span").html(this.isGroupView ? "Show flat tree" : "Show group tree");
that.ui[type + "SearchTree"].jstree(true).destroy();
......@@ -210,7 +208,6 @@ define([
this.classificationSwitchBtnUpdate();
},
classificationSwitchBtnUpdate: function() {
// this.ui.showEmptyClassifications.attr("title", (this.isEmptyClassification ? "Show" : "Hide") + " unused classification");
this.ui.showEmptyClassifications.attr("data-original-title", (this.isEmptyClassification ? "Show" : "Hide") + " unused classification");
this.ui.showEmptyClassifications.tooltip('hide');
this.ui.showEmptyClassifications.find("i").toggleClass("fa-toggle-on fa-toggle-off");
......@@ -366,16 +363,14 @@ define([
flatViewList = [],
isSelectedChild = false,
openClassificationNodesState = function(treeDate) {
// if (treeDate.length == 1) {
_.each(treeDate, function(model) {
model.state['opened'] = true;
})
// }
},
generateNode = function(nodeOptions, options, isChild) {
var nodeStructure = {
text: nodeOptions.name,
name: nodeOptions.name,
text: _.escape(nodeOptions.name),
name: _.escape(nodeOptions.name),
children: that.isGroupView ? getChildren({
children: isChild ? nodeOptions.model.subTypes : nodeOptions.model.get("subTypes"),
parent: isChild ? options.parentName : nodeOptions.name
......@@ -409,14 +404,14 @@ define([
var modelJSON = child.toJSON();
if (child) {
var nodeDetails = {
name: name,
name: _.escape(name),
model: modelJSON,
children: child,
isSelectedChild: isSelectedChild
},
nodeProperties = {
parent: options.parentName,
text: tagname,
text: _.escape(tagname),
guid: child.get("guid"),
model: child,
state: { selected: isSelectedChild, opened: true }
......@@ -451,12 +446,12 @@ define([
}
}
var parentNodeDetails = {
name: name,
name: _.escape(name),
model: model,
isSelectedChild: isSelectedChild
},
parentNodeProperties = {
text: tagname,
text: _.escape(tagname),
state: {
disabled: tagEntityCount == 0 ? true : false,
selected: isSelected,
......@@ -488,7 +483,6 @@ define([
var classificationTreeData = that.isEmptyClassification ? listWithEmptyParents : listOfParents;
var flatViewClassificaton = that.isEmptyClassification ? listWithEmptyParentsFlatView : flatViewList;
var classificationData = that.isGroupView ? classificationTreeData : flatViewClassificaton;
// openClassificationNodesState(classificationData);
return classificationData;
},
generateSearchTree: function(options) {
......@@ -517,9 +511,9 @@ define([
},
node_customize: {
default: function(el) {
// if ($(el).find(".fa-ellipsis-h").length === 0) {
var aTag = $(el).find(">a.jstree-anchor");
aTag.append("<span class='tree-tooltip'>" + aTag.text() + "</span>");
$(el).append('<div class="tools"><i class="fa fa-ellipsis-h classificationPopover" rel="popover"></i></div>');
// }
}
},
core: {
......@@ -552,16 +546,23 @@ define([
} else {
$el.parents(".panel").removeClass("hide");
}
})
}).on("hover_node.jstree", function(nodes, str, res) {
var aTag = that.$("#" + str.node.a_attr.id),
tagOffset = aTag.find(">.jstree-icon").offset();
that.$(".tree-tooltip").removeClass("show");
if (tagOffset.top && tagOffset.left) {
aTag.find(">span.tree-tooltip").css({
top: "calc(" + tagOffset.top + "px - 45px)",
left: "24px"
}).addClass("show");
}
}).on("dehover_node.jstree", function(nodes, str, res) {
that.$(".tree-tooltip").removeClass("show");
});
},
onClickCreateTag: function(e) {
var that = this;
//nodeName = that.options.value && that.options.value.tag;
require(["views/tag/CreateTagLayoutView", "modules/Modal"], function(CreateTagLayoutView, Modal) {
// var name = !(nodeName == "BUTTON") ? that.query[that.viewType].tagName : null;
//var name = nodeName;
var view = new CreateTagLayoutView({ tagCollection: that.options.classificationDefCollection, enumDefCollection: enumDefCollection }),
modal = new Modal({
title: "Create a new classification",
......@@ -593,7 +594,6 @@ define([
});
modal.on("closeModal", function() {
modal.trigger("cancel");
// that.ui.createTag.removeAttr("disabled");
});
});
},
......@@ -691,7 +691,6 @@ define([
new this.options.classificationDefCollection.model().set(this.json).save(null, {
success: function(model, response) {
var classificationDefs = model.get("classificationDefs");
// that.ui.createTag.removeAttr("disabled");
that.createTag = true;
if (classificationDefs[0]) {
_.each(classificationDefs[0].superTypes, function(superType) {
......
......@@ -208,6 +208,8 @@ define([
},
node_customize: {
default: function(el) {
var aFilter = $(el).find(">a.jstree-anchor");
aFilter.append("<span class='tree-tooltip'>" + _.escape(aFilter.text()) + "</span>");
if ($(el).find(".fa-ellipsis-h").length === 0) {
$(el).append('<div class="tools"><i class="fa fa-ellipsis-h customFilterPopover" rel="popover"></i></div>');
}
......@@ -239,7 +241,19 @@ define([
} else {
$el.parents(".panel").removeClass("hide");
}
})
}).on("hover_node.jstree", function(nodes, str, res) {
var aFilter = that.$("#" + str.node.a_attr.id),
filterOffset = aFilter.find(">.jstree-icon").offset();
that.$(".tree-tooltip").removeClass("show");
if (filterOffset.top && filterOffset.left) {
aFilter.find(">span.tree-tooltip").css({
top: "calc(" + filterOffset.top + "px - 45px)",
left: "24px"
}).addClass("show");
}
}).on("dehover_node.jstree", function(nodes, str, res) {
that.$(".tree-tooltip").removeClass("show");
});
},
createCustomFilterAction: function() {
var that = this;
......@@ -262,7 +276,6 @@ define([
customFilterSwitchBtnUpdate: function() {
var that = this,
getTreeData, displayText;
// that.ui.showCustomFilter.attr("title", (that.isBasic ? "Show Advanced search" : "Show Basic search"));
that.ui.showCustomFilter.attr("data-original-title", (that.isBasic ? "Show Advanced search" : "Show Basic search"));
that.ui.showCustomFilter.tooltip('hide');
that.ui.showCustomFilter.find("i").toggleClass("switch-button");
......@@ -285,8 +298,8 @@ define([
generateNode = function(nodeOptions) {
var searchType = nodeOptions.get('searchType');
var nodeStructure = {
text: nodeOptions.get('name'),
name: nodeOptions.get('name'),
text: _.escape(nodeOptions.get('name')),
name: _.escape(nodeOptions.get('name')),
type: "customFilter",
id: nodeOptions.get('guid'),
icon: (searchType === 'BASIC' ? "fa fa-circle-thin basic-tree" : "fa fa-circle-thin advance-tree"),
......@@ -306,7 +319,6 @@ define([
allCustomFilter.push(generateNode(filterNode));
});
// var customFilterList = that.isBasic ? customFilterBasicList : customFilterAdvanceList;
var treeView = [{
icon: "fa fa-folder-o",
gType: "customFilter",
......
......@@ -70,9 +70,7 @@ define([
var type = $(e.currentTarget).data("type");
e.stopPropagation();
this.isGroupView = !this.isGroupView;
// this.ui.groupOrFlatTree.attr("data-original-title", (this.isGroupView ? "Show flat tree" : "Show group tree"));
this.ui.groupOrFlatTree.tooltip('hide');
// this.ui.groupOrFlatTree.find("i").toggleClass("group-tree-deactivate");
this.ui.groupOrFlatTree.find("i").toggleClass("fa-sitemap fa-list-ul");
this.ui.groupOrFlatTree.find("span").html(this.isGroupView ? "Show flat tree" : "Show group tree");
......@@ -158,11 +156,9 @@ define([
this.entitySwitchBtnUpdate();
},
entitySwitchBtnUpdate: function() {
// this.ui.showEmptyServiceType.attr("title", (this.isEmptyServicetype ? "Show" : "Hide") + " empty service types");
this.ui.showEmptyServiceType.attr("data-original-title", (this.isEmptyServicetype ? "Show" : "Hide") + " empty service types");
this.ui.showEmptyServiceType.tooltip('hide');
this.ui.showEmptyServiceType.find("i").toggleClass("fa-toggle-on fa-toggle-off");
// this.ui.showEmptyServiceType.find("span").html((this.isEmptyServicetype ? "Show" : "Hide") + " empty service types");
this.ui.entitySearchTree.jstree(true).refresh();
},
manualRender: function(options) {
......@@ -219,7 +215,7 @@ define([
} else {
that.typeId = params["type"] = null;
that.ui.entitySearchTree.jstree(true).deselect_all(true);
if (!that.options.value.type && !that.options.value.tag && !that.options.value.term && !that.options.value.query) {
if (!that.options.value.type && !that.options.value.tag && !that.options.value.term && !that.options.value.query && !this.options.value.udKeys && !this.options.value.ugLabels) {
that.showDefaultPage();
return;
}
......@@ -297,24 +293,9 @@ define([
that.typeId = isSelected ? model.get("guid") : null;
}
}
// var children = {
// text: modelname,
// name: model.get("name"),
// type: model.get("category"),
// gType: "serviceType",
// guid: model.get("guid"),
// id: model.get("guid"),
// parent: serviceType,
// model: model,
// icon: "fa fa-file-o",
// state: {
// disabled: entityCount == 0 ? true : false,
// selected: isSelected
// },
// };
var children = {
text: modelname,
text: _.escape(modelname),
name: model.get("name"),
type: model.get("category"),
gType: "serviceType",
......@@ -378,7 +359,7 @@ define([
type: type,
gType: "serviceType",
children: getParrent.children,
text: textName,
text: _.escape(textName),
name: data[parents[i]].name,
id: i,
state: { opened: true }
......@@ -432,7 +413,8 @@ define([
},
node_customize: {
default: function(el) {
//$(el).find("a").append("<div><i class='fa fa-ellipsis-h'></i></div>");
var aType = $(el).find(">a.jstree-anchor");
aType.append("<span class='tree-tooltip'>" + aType.text() + "</span>");
if ($(el).find(".fa-ellipsis-h").length === 0) {
$(el).append('<div class="tools"><i class="fa fa-ellipsis-h entityPopover" rel="popover"></i></div>');
}
......@@ -443,14 +425,6 @@ define([
data: function(node, cb) {
if (node.id === "#") {
cb(
// {
// text: "Service Types",
// children: that.getEntityTree(),
// icon: "fa fa-folder-o",
// type: "ENTITY",
// state: { opened: true },
// parent: "#"
// }
that.getEntityTree()
);
}
......@@ -478,7 +452,19 @@ define([
} else {
$el.parents(".panel").removeClass("hide");
}
})
}).on("hover_node.jstree", function(nodes, str, res) {
var aType = that.$("#" + str.node.a_attr.id),
typeOffset = aType.find(">.jstree-icon").offset();
that.$(".tree-tooltip").removeClass("show");
if (typeOffset.top && typeOffset.left) {
aType.find(">span.tree-tooltip").css({
top: "calc(" + typeOffset.top + "px - 45px)",
left: "24px"
}).addClass("show");
}
}).on("dehover_node.jstree", function(nodes, str, res) {
that.$(".tree-tooltip").removeClass("show");
});
},
refresh: function(options) {
var that = this,
......
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