Skip to content

Commit

Permalink
Upd: show tag and match as placeholder in search expression input
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed Sep 13, 2024
1 parent c02f572 commit 5c63c93
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions htdocs/js/searchExpression.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ function selectSearchMatch(appid) {
searchMatchEl.value = 'contains';
}
}
setSearchExpressionPlaceholder(appid);
}

/**
* Sets the placeholder string for the search expression input
* @param {string} appid the application id
* @returns {void}
*/
function setSearchExpressionPlaceholder(appid) {
const searchMatchEl = elGetById(appid + 'SearchMatch');
const searchTagEl = elGetById(appid + 'SearchTagsDesc');
elGetById(appid + 'SearchStr').setAttribute('placeholder', tn(searchTagEl.textContent) + ' ' + tn(searchMatchEl.value));
}

/**
Expand Down Expand Up @@ -169,6 +181,7 @@ function initSearchExpression(appid) {
elGetById(appid + 'SearchMatch').addEventListener('change', function() {
execSearchExpression(elGetById(appid + 'SearchStr').value);
}, false);
setSearchExpressionPlaceholder(appid);
}

/**
Expand Down

0 comments on commit 5c63c93

Please sign in to comment.