@cryptotaxi247 / netdata-1 / commits / 1256221f1

fix for "On Focus" / "Always" being refreshing the page without applying the change #191

Costa Tsaousis (ktsaou) committed Apr 6, 2016 at 16:02 UTC 1256221f1b0209caeb44d7b08a5bd518516a3576
1 file changed +6 -4
web/index.html
+6 -4
@@ -323,6 +323,8 @@
323 var netdataTheme = getTheme('slate');
324
325 function setTheme(theme) {
326 + if(theme === netdataTheme) return false;
327 +
328 return saveLocalStorage('netdataTheme', theme);
329 }
330 </script>
@@ -633,7 +635,7 @@
635 <!-- Tab panes -->
636 <div class="tab-content">
637 <div role="tabpanel" class="tab-pane active" id="settings_performance">
636 - <form id="optionsForm" method="get" class="form-horizontal">
638 + <form id="optionsForm1" method="get" class="form-horizontal">
639 <div class="form-group">
640 <table>
641 <tr class="option-row">
@@ -661,7 +663,7 @@
663 </form>
664 </div>
665 <div role="tabpanel" class="tab-pane" id="settings_sync">
664 - <form id="optionsForm" method="get" class="form-horizontal">
666 + <form id="optionsForm2" method="get" class="form-horizontal">
667 <div class="form-group">
668 <table>
669 <tr class="option-row">
@@ -703,7 +705,7 @@
705 </form>
706 </div>
707 <div role="tabpanel" class="tab-pane" id="settings_visual">
706 - <form id="optionsForm" method="get" class="form-horizontal">
708 + <form id="optionsForm3" method="get" class="form-horizontal">
709 <div class="form-group">
710 <table>
711 <tr class="option-row">
@@ -1817,7 +1819,7 @@ function finalizePage() {
1819
1820 // this has to be the last
1821 // it reloads the page
1820 - $('#netdata_theme_control').change(function() {
1822 + $('#netdata_theme_control').change(function() {
1823 if(setTheme($(this).prop('checked')?'slate':'default'))
1824 location.reload();
1825 });