mirror of
https://github.com/unraid/webgui.git
synced 2026-04-28 13:59:21 -05:00
Display: reset dashboard tiles when switching language
This commit is contained in:
@@ -26,6 +26,7 @@ require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php"
|
||||
<script>
|
||||
var path = '/boot/config/plugins/dynamix';
|
||||
var filename = '';
|
||||
var locale = "<?=$locale?>";
|
||||
|
||||
function restore() {
|
||||
// restore original image and activate APPLY button
|
||||
@@ -33,13 +34,21 @@ function restore() {
|
||||
$('select[name="banner"]').trigger('change');
|
||||
filename = 'reset';
|
||||
}
|
||||
function upload() {
|
||||
function upload(lang) {
|
||||
// save or delete upload when APPLY is pressed
|
||||
if (filename=='reset') {
|
||||
$.post("/webGui/include/FileUpload.php",{cmd:'delete',path:path,filename:'banner.png'});
|
||||
} else if (filename) {
|
||||
$.post("/webGui/include/FileUpload.php",{cmd:'save',path:path,filename:filename,output:'banner.png'});
|
||||
}
|
||||
// reset dashboard tiles when switching language
|
||||
if (lang != locale) {
|
||||
$.removeCookie('db-box1');
|
||||
$.removeCookie('db-box2');
|
||||
$.removeCookie('db-box3');
|
||||
$.removeCookie('inactive_content');
|
||||
$.removeCookie('hidden_content');
|
||||
}
|
||||
}
|
||||
function presetTime(form) {
|
||||
var system = form.date.selectedIndex==0;
|
||||
@@ -119,7 +128,7 @@ $(function() {
|
||||
|
||||
:display_settings_help:
|
||||
|
||||
<form markdown="1" name="display_settings" method="POST" action="/update.php" target="progressFrame" onsubmit="upload()">
|
||||
<form markdown="1" name="display_settings" method="POST" action="/update.php" target="progressFrame" onsubmit="upload(this.locale.value)">
|
||||
<input type="hidden" name="#file" value="dynamix/dynamix.cfg">
|
||||
<input type="hidden" name="#section" value="display">
|
||||
<input type="hidden" name="rtl" value="<?=$display['rtl']?>">
|
||||
|
||||
@@ -30,6 +30,14 @@ function LanguageButton() {
|
||||
switchLanguage($.cookie('locale'));
|
||||
$.removeCookie('locale');
|
||||
}
|
||||
// reset dashboard tiles when switching language
|
||||
if (locale != ($.cookie('locale')||'')) {
|
||||
$.removeCookie('db-box1');
|
||||
$.removeCookie('db-box2');
|
||||
$.removeCookie('db-box3');
|
||||
$.removeCookie('inactive_content');
|
||||
$.removeCookie('hidden_content');
|
||||
}
|
||||
}
|
||||
|
||||
function switchLanguage(lang) {
|
||||
|
||||
Reference in New Issue
Block a user