Commit c950c9bd by kevalbhatt Committed by Madhan Neethiraj

ATLAS-2713: Glossary UI: enable assign button only when correct object-type is selected

parent 1616b3f9
...@@ -87,6 +87,7 @@ define(['require', ...@@ -87,6 +87,7 @@ define(['require',
"mainClass": "wizard-modal" "mainClass": "wizard-modal"
}); });
this.modal.open(); this.modal.open();
this.modal.$el.find('button.ok').attr("disabled", true);
this.modal.on('closeModal', function() { this.modal.on('closeModal', function() {
that.modal.trigger('cancel'); that.modal.trigger('cancel');
if (that.assignTermError && that.hideLoader) { if (that.assignTermError && that.hideLoader) {
...@@ -99,8 +100,13 @@ define(['require', ...@@ -99,8 +100,13 @@ define(['require',
this.modal.on('ok', function() { this.modal.on('ok', function() {
that.assignTerm(); that.assignTerm();
}); });
this.bindEvents();
},
bindEvents: function() {
this.listenTo(this.glossaryCollection, "node_selected", function(skip) {
this.modal.$el.find('button.ok').attr("disabled", false);
}, this);
}, },
bindEvents: function() {},
onRender: function() { onRender: function() {
this.renderGlossaryTree(); this.renderGlossaryTree();
var that = this; var that = this;
......
...@@ -256,7 +256,11 @@ define(['require', ...@@ -256,7 +256,11 @@ define(['require',
var objGuid = options.objGuid, var objGuid = options.objGuid,
node = options.node, node = options.node,
index = options.index; index = options.index;
if (!that.guid) { if (that.isAssignView) {
return {
'opened': true
}
} else if (!that.guid) {
that.query[that.viewType].isNodeNotFoundAtLoad = false; that.query[that.viewType].isNodeNotFoundAtLoad = false;
var selectedItem = { var selectedItem = {
"type": "Glossary", "type": "Glossary",
...@@ -461,6 +465,7 @@ define(['require', ...@@ -461,6 +465,7 @@ define(['require',
.on("select_node.jstree", function(e, data) { .on("select_node.jstree", function(e, data) {
if (that.isAssignView) { if (that.isAssignView) {
that.glossary.selectedItem = data.node.original; that.glossary.selectedItem = data.node.original;
that.glossaryCollection.trigger("node_selected");
} else { } else {
var popoverClassName = (type == "term" ? '.termPopover' : '.categoryPopover'), var popoverClassName = (type == "term" ? '.termPopover' : '.categoryPopover'),
currentClickedPopoverEl = ""; currentClickedPopoverEl = "";
......
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