Skip to content

Commit

Permalink
updated pomadded paging code
Browse files Browse the repository at this point in the history
  • Loading branch information
prasadveautodesk committed Jan 29, 2018
1 parent 1b12673 commit d93be4a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions src/main/resources/js/jira-ldap-group-sync-plugin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
function adskldapsyncconfig_filter(element) {
/* global AJS */

function adskldapsyncconfig_filter() {
// Declare variables
var count, input, filter, table, tr, td, i;
var count, input, filter, table, tr, i;
count = document.getElementById("adskldapsyncconfig_count");
input = document.getElementById("adskldapsyncconfig_search");
filter = input.value.toUpperCase();
Expand All @@ -10,17 +12,17 @@ function adskldapsyncconfig_filter(element) {
// Loop through all table rows, and hide those who don't match the search query
var size = 0;
for (i = 0; i < tr.length; i++) {
td0 = tr[i].getElementsByTagName("td")[1];
td1 = tr[i].getElementsByTagName("td")[2];
var td0 = tr[i].getElementsByTagName("td")[1];
var td1 = tr[i].getElementsByTagName("td")[2];
if (td0 || td1) {
if (td0.innerHTML.toUpperCase().indexOf(filter) > -1 ||
td1.innerHTML.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
size++;
size++;
} else {
tr[i].style.display = "none";
tr[i].style.display = "none";
}
}
}
count.innerHTML = size;
count.innerHTML = size;
}
4 changes: 2 additions & 2 deletions src/main/resources/templates/ldap_group_sync_map.vm
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
<p>
<span class="adskldapsyncconfig_count_span">Count &diams; <span id="adskldapsyncconfig_count">$configList.size()</span></span>
<div class="adskldapsyncconfig_search_div">
<input type="text" id="adskldapsyncconfig_search" placeholder=" Search" onkeyup="adskldapsyncconfig_filter(this)" />
<input type="text" id="adskldapsyncconfig_search" placeholder=" Search" onkeyup="adskldapsyncconfig_filter();" />
</div>
</p>

Expand All @@ -213,7 +213,7 @@
'$textutils.htmlEncode($entry.jiraGroup)')"></a>
</td>
</tr>
#end
#end
</table>

</body>
Expand Down

0 comments on commit d93be4a

Please sign in to comment.