fix xml error

This commit is contained in:
Ivan Office
2024-08-19 21:40:50 +08:00
parent 7025bb9611
commit 7d14564dba
11 changed files with 33 additions and 33 deletions

View File

@@ -41,28 +41,28 @@ export class WebEnvironmentRibbon extends Component {
}
showRibbon() {
const ribbon = $(".test-ribbon");
const ribbon = document.querySelector('.test-ribbon');
const self = this;
ribbon.hide();
ribbon.classList.add('o_hidden');
// Get ribbon data from backend
self.orm
.call("web.environment.ribbon.backend", "get_environment_ribbon")
.then(function (ribbon_data) {
// Ribbon name
if (ribbon_data.name && ribbon_data.name !== "False") {
ribbon.show();
ribbon.classList.remove('o_hidden');
ribbon.html(ribbon_data.name);
}
// Ribbon color
if (ribbon_data.color && self.validStrColour(ribbon_data.color)) {
ribbon.css("color", ribbon_data.color);
ribbon.style.color = ribbon_data.color;
}
// Ribbon background color
if (
ribbon_data.background_color &&
self.validStrColour(ribbon_data.background_color)
) {
ribbon.css("background-color", ribbon_data.background_color);
ribbon.style.backgroundColor = ribbon_data.background_color;
}
});
}

View File

@@ -3,7 +3,7 @@
import { _t } from "@web/core/l10n/translation";
import { UserMenu } from "@web/webclient/user_menu/user_menu";
import { routeToUrl } from "@web/core/browser/router_service";
import { router } from "@web/core/browser/router";
import { patch } from "@web/core/utils/patch";
import { browser } from "@web/core/browser/browser";
import { registry } from "@web/core/registry";
@@ -17,7 +17,6 @@ patch(UserMenu.prototype, {
"use strict";
// this.companyService = useService("company");
this.rpc = useService("rpc");
this.orm = useService("orm");
this.app_show_lang = session.app_show_lang;
this.app_lang_list = session.app_lang_list;
@@ -111,7 +110,7 @@ function debugItem(env) {
id: "debug",
description: _t("Activate the developer mode"),
callback: () => {
browser.location.search = "?debug=1";
router.pushState({ debug: 1 }, { reload: true });
},
sequence: 5,
};
@@ -123,7 +122,7 @@ function activateAssetsDebugging(env) {
type: "item",
description: _t("Activate Assets Debugging"),
callback: () => {
browser.location.search = "?debug=assets";
router.pushState({ debug: 'assets' }, { reload: true });
},
sequence: 6,
};
@@ -135,9 +134,7 @@ function leaveDebugMode(env) {
type: "item",
description: _t("Leave the Developer Tools"),
callback: () => {
const route = env.services.router.current;
route.search.debug = "";
browser.location.href = browser.location.origin + routeToUrl(route);
router.pushState({ debug: 0 }, { reload: true });
},
sequence: 7,
};