fix buttons for hidden indexers

This commit is contained in:
kaso17 2017-01-28 08:01:47 +01:00
parent d01710c285
commit 3566206a68
1 changed files with 12 additions and 12 deletions

View File

@ -103,6 +103,10 @@ function displayConfiguredIndexersList(indexers) {
var indexersTemplate = Handlebars.compile($("#configured-indexer-table").html()); var indexersTemplate = Handlebars.compile($("#configured-indexer-table").html());
var indexersTable = $(indexersTemplate({ indexers: indexers, total_configured_indexers: indexers.length })); var indexersTable = $(indexersTemplate({ indexers: indexers, total_configured_indexers: indexers.length }));
prepareTestButtons(indexersTable); prepareTestButtons(indexersTable);
prepareSearchButtons(indexersTable);
prepareSetupButtons(indexersTable);
prepareDeleteButtons(indexersTable);
prepareCopyButtons(indexersTable);
indexersTable.find("table").DataTable( indexersTable.find("table").DataTable(
{ {
"stateSave": true, "stateSave": true,
@ -128,10 +132,6 @@ function displayConfiguredIndexersList(indexers) {
$('#indexers').empty(); $('#indexers').empty();
$('#indexers').append(indexersTable); $('#indexers').append(indexersTable);
$('#indexers').fadeIn(); $('#indexers').fadeIn();
prepareSearchButtons();
prepareSetupButtons();
prepareDeleteButtons();
prepareCopyButtons();
} }
function displayUnconfiguredIndexersList() { function displayUnconfiguredIndexersList() {
@ -255,8 +255,8 @@ function copyToClipboard(text) {
return succeed; return succeed;
} }
function prepareCopyButtons() { function prepareCopyButtons(element) {
$(".indexer-button-copy").each(function (i, btn) { element.find(".indexer-button-copy").each(function (i, btn) {
var $btn = $(btn); var $btn = $(btn);
var title = $btn[0].title; var title = $btn[0].title;
@ -272,8 +272,8 @@ function prepareCopyButtons() {
}); });
} }
function prepareDeleteButtons() { function prepareDeleteButtons(element) {
$(".indexer-button-delete").each(function (i, btn) { element.find(".indexer-button-delete").each(function (i, btn) {
var $btn = $(btn); var $btn = $(btn);
var id = $btn.data("id"); var id = $btn.data("id");
$btn.click(function () { $btn.click(function () {
@ -293,8 +293,8 @@ function prepareDeleteButtons() {
}); });
} }
function prepareSearchButtons() { function prepareSearchButtons(element) {
$('.indexer-button-search').each(function (i, btn) { element.find('.indexer-button-search').each(function (i, btn) {
var $btn = $(btn); var $btn = $(btn);
var id = $btn.data("id"); var id = $btn.data("id");
$btn.click(function() { $btn.click(function() {
@ -303,8 +303,8 @@ function prepareSearchButtons() {
}); });
} }
function prepareSetupButtons() { function prepareSetupButtons(element) {
$('.indexer-setup').each(function (i, btn) { element.find('.indexer-setup').each(function (i, btn) {
var $btn = $(btn); var $btn = $(btn);
var id = $btn.data("id"); var id = $btn.data("id");
var link = $btn.data("link"); var link = $btn.data("link");