Commit 62458388 by kevalbhatt

ATLAS-3628 : Beta UI: Wildcard Search for classifications doesn't fire any search

parent 6eb72fa4
...@@ -207,11 +207,29 @@ ...@@ -207,11 +207,29 @@
span { span {
color: #fff !important; color: #fff !important;
} }
.clear-icon {
color: $color_ironside_gray_approx !important;
}
.wildcard-btn {
color: $color_jungle_green_approx !important;
}
}
.wildcard-btn {
margin: 0px;
color: $color_jungle_green_approx !important;
}
.wildcard-btn:hover {
margin: 0px;
color: $white !important;
} }
input { input {
color: $color_ironside_gray_approx !important; color: $color_ironside_gray_approx !important;
width: 150px; width: 130px;
display: inline-block; display: inline-block;
} }
...@@ -219,7 +237,8 @@ ...@@ -219,7 +237,8 @@
background-color: #fff; background-color: #fff;
} }
&:hover .clear-icon {
.clear-icon {
color: $color_ironside_gray_approx !important; color: $color_ironside_gray_approx !important;
} }
...@@ -237,12 +256,23 @@ ...@@ -237,12 +256,23 @@
.clear-icon { .clear-icon {
color: $color_ironside_gray_approx !important; color: $color_ironside_gray_approx !important;
position: absolute; position: absolute;
top: 30%; z-index: 3;
right: 12px; top: 29%;
right: 48px;
}
.has-feedback input {
padding: 6px 25px 6px 6px;
} }
.has-feedback .form-control { .has-feedback input:focus {
padding: 6px 12px; border-color: $color_havelock_blue_approx !important;
}
.wildcard-search:hover {
background-color: $white;
} }
} }
......
...@@ -34,13 +34,17 @@ ...@@ -34,13 +34,17 @@
</li> </li>
<li data-id="createTag" data-type="classification"> <i class="fa fa-plus"></i><span>Create Classification</span> <li data-id="createTag" data-type="classification"> <i class="fa fa-plus"></i><span>Create Classification</span>
</li> </li>
<li data-id="wildCardClick" data-type="classification"> <li class="wildcard-search" data-type="classification" data-id="wildCardContainer">
<div class="has-feedback align-left-right-icon search-box"> <div class="has-feedback align-left-right-icon search-box">
<div class="input-group">
<input type="text" class="form-control" name="wildcard search" placeholder="Wildcard search" data-id="wildCardValue" /> <input type="text" class="form-control" name="wildcard search" placeholder="Wildcard search" data-id="wildCardValue" />
<span class="fa fa-times clear-icon" data-id="clearWildCard"> </span> <span class="fa fa-times clear-icon" data-id="clearWildCard"> </span>
<div class="input-group-btn">
<span class="btn btn-md wildcard-btn btn-action" data-id="wildCardSearch" data-original-title="Wildcard Search"><i class="fa fa-search"></i></span>
</div>
</div>
</div> </div>
</li> </li>
</button>
</ul> </ul>
</button> </button>
</div> </div>
......
...@@ -52,6 +52,7 @@ define([ ...@@ -52,6 +52,7 @@ define([
wildCardClick: '[data-id="wildCardClick"]', wildCardClick: '[data-id="wildCardClick"]',
wildCardSearch: '[data-id="wildCardSearch"]', wildCardSearch: '[data-id="wildCardSearch"]',
wildCardValue: '[data-id="wildCardValue"]', wildCardValue: '[data-id="wildCardValue"]',
wildCardContainer: '[data-id="wildCardContainer"]',
clearWildCard: '[data-id="clearWildCard"]' clearWildCard: '[data-id="clearWildCard"]'
}, },
templateHelpers: function() { templateHelpers: function() {
...@@ -69,7 +70,8 @@ define([ ...@@ -69,7 +70,8 @@ define([
that.refresh({ type: type }); that.refresh({ type: type });
}; };
events["click " + this.ui.createTag] = function() { events["click " + this.ui.createTag] = function(e) {
e.stopPropagation();
that.onClickCreateTag(); that.onClickCreateTag();
}; };
...@@ -96,7 +98,9 @@ define([ ...@@ -96,7 +98,9 @@ define([
events["click " + this.ui.wildCardSearch] = function(e) { events["click " + this.ui.wildCardSearch] = function(e) {
e.stopPropagation(); e.stopPropagation();
var tagValue = this.ui.wildCardValue.val(); var tagValue = this.ui.wildCardValue.val();
if (tagValue.indexOf("*") != -1) {
that.findSearchResult(tagValue); that.findSearchResult(tagValue);
}
}; };
events["click " + this.ui.wildCardValue] = function(e) { events["click " + this.ui.wildCardValue] = function(e) {
e.stopPropagation(); e.stopPropagation();
...@@ -104,8 +108,12 @@ define([ ...@@ -104,8 +108,12 @@ define([
events["click " + this.ui.clearWildCard] = function(e) { events["click " + this.ui.clearWildCard] = function(e) {
e.stopPropagation(); e.stopPropagation();
that.ui.wildCardValue.val(""); that.ui.wildCardValue.val("");
that.ui.clearWildCard.addClass('hide-icon');
} }
events["keyup " + this.ui.wildCardValue] = function(e) { events["click " + this.ui.wildCardContainer] = function(e) {
e.stopPropagation();
}
events["keydown " + this.ui.wildCardValue] = function(e) {
e.stopPropagation(); e.stopPropagation();
var code = e.which; var code = e.which;
if (this.ui.wildCardValue.val().length > 0) { if (this.ui.wildCardValue.val().length > 0) {
...@@ -114,14 +122,17 @@ define([ ...@@ -114,14 +122,17 @@ define([
this.ui.clearWildCard.addClass('hide-icon'); this.ui.clearWildCard.addClass('hide-icon');
} }
if (code == 13) { if (code == 13) {
e.preventDefault();
var tagValue = this.ui.wildCardValue.val(); var tagValue = this.ui.wildCardValue.val();
if (tagValue.indexOf("*") != -1) { if (tagValue.indexOf("*") != -1) {
that.findSearchResult(tagValue); that.findSearchResult(tagValue);
} }
} }
}; };
events["keyup " + this.ui.wildCardValue] = function(e) {
e.stopPropagation();
e.preventDefault();
};
return events; return events;
}, },
initialize: function(options) { initialize: function(options) {
......
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