You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
When call html_header_sort() with the last parameter ($return_to) is set to un-main, the search icon will duplicate after click the table header to resort. Because the setupSortable() will call the applySkin() again, and we add the search icon without check it existance.
To Reproduce
Steps to reproduce the behavior:
In a web page, which has a search filter and a data table, call html_header_sort() with the last parameter ($return_to) is set to un-main, to only update the table area.
Click on the table header to resort.
Check the search filter and the icon.
Expected behavior
A clear and concise description of what you expected to happen.
Check the search icon existance to avoid duplicated icon. add it only when no icon is there.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: [e.g. iOS]
Browser [e.g. chrome, safari]
Version [e.g. 22]
Smartphone (please complete the following information):
Device: [e.g. iPhone6]
OS: [e.g. iOS8.1]
Browser [e.g. stock browser, safari]
Version [e.g. 22]
Additional context
Add any other context about the problem here.
--- rtm/cacti/include/themes/modern/main.js 2019-03-31 02:45:32.000000000 +0800
+++ rtm/cacti/include/themes/modern/main.js 2019-05-22 09:45:21.000000551 +0800
@@ -16,15 +16,15 @@
setMenuVisibility();
// Add nice search filter to filters
- if ($('input[id="filter"]').length > 0) {
+ if ($('input[id="filter"]').length > 0 && $('input[id="filter"] + i[class="fa fa-search filter"]').length < 1) {
$('input[id="filter"]').after("<i class='fa fa-search filter'/>").attr('autocomplete', 'off').attr('placeholder', searchFilter).parent('td').css('white-space', 'nowrap');
}
- if ($('input[id="filterd"]').length > 0) {
+ if ($('input[id="filterd"]').length > 0 && $('input[id="filterd"] + i[class="fa fa-search filter"]').length < 1) {
$('input[id="filterd"]').after("<i class='fa fa-search filter'/>").attr('autocomplete', 'off').attr('placeholder', searchFilter).parent('td').css('white-space', 'nowrap');
}
- if ($('input[id="rfilter"]').length > 0) {
+ if ($('input[id="rfilter"]').length > 0 && $('input[id="rfilter"] + i[class="fa fa-search filter"]').length < 1) {
$('input[id="rfilter"]').after("<i class='fa fa-search filter'/>").attr('autocomplete', 'off').attr('placeholder', searchRFilter).parent('td').css('white-space', 'nowrap');
}
We need to add the check in all theme files below,
./include/themes/paw/main.js
./include/themes/modern/main.js
./include/themes/paper-plane/main.js
./include/themes/dark/main.js
./include/themes/classic/main.js
./include/themes/sunrise/main.js
The text was updated successfully, but these errors were encountered:
cigamit
changed the title
Need check the search icon existance to avoid duplicated icon in the main.js of all themes
Avoid duplicated icon in the main.js of all themes
May 22, 2019
Describe the bug
A clear and concise description of what the bug is.
When call html_header_sort() with the last parameter ($return_to) is set to un-main, the search icon will duplicate after click the table header to resort. Because the setupSortable() will call the applySkin() again, and we add the search icon without check it existance.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Check the search icon existance to avoid duplicated icon. add it only when no icon is there.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: