Skip to content

Commit

Permalink
Merge pull request #73 from GluuFederation/issues_2218
Browse files Browse the repository at this point in the history
feat(oxtrust): add property search field
  • Loading branch information
yurem authored Dec 27, 2024
2 parents 4ea5407 + b018095 commit 7d17bf2
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@

</ul>
<div class="tab-content">
<input type="text" id="searchProp" placeholder="Search for properties.."/>
<input id="clickMe" style="display:none; margin-top: 5px;"
class="btn btn-primary" type="button" value="search" onclick="scrolltoProperty();" />
<!-- System Configuration -->
<div class="tab-pane active" id="oxtrust-config">
<h:panelGrid border="0" cellpadding="0" cellspacing="0"
Expand Down Expand Up @@ -276,6 +279,37 @@
'show');
}
});

var i = 0;
var max = 0;
var oldSearch = "";
function scrolltoProperty() {
var e = document.getElementById("searchProp");
var activeElement = $('div.active');

if(e.value.length > 2){
if (e.value != "") {
var elem = activeElement[0].querySelectorAll("[data-schemaid*=" + e.value + " i]");

if (elem[i] != undefined) {

if (oldSearch == e.value) {
elem[i].scrollIntoView();
} else {
i = 0;
elem[i].scrollIntoView();
}
i = i + 1;
oldSearch = e.value;
} else {
e.scrollIntoView();
i=0;
}
}
}else{
alert("Please enter more than 3 letters.");
}
}
</script>

</div>
Expand Down

0 comments on commit 7d17bf2

Please sign in to comment.