mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #2805 from kelvininc/user_menu_theme_improvement
Allow to explicit use userMenu in the theme configuration
This commit is contained in:
commit
3885107e6e
@ -219,7 +219,7 @@ RED.user = (function() {
|
|||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
if (RED.settings.user) {
|
if (RED.settings.user) {
|
||||||
if (!RED.settings.editorTheme || !RED.settings.editorTheme.hasOwnProperty("userMenu")) {
|
if (!RED.settings.editorTheme || !RED.settings.editorTheme.hasOwnProperty("userMenu") || RED.settings.editorTheme.userMenu) {
|
||||||
|
|
||||||
var userMenu = $('<li><a id="red-ui-header-button-user" class="button hide" href="#"></a></li>')
|
var userMenu = $('<li><a id="red-ui-header-button-user" class="button hide" href="#"></a></li>')
|
||||||
.prependTo(".red-ui-header-toolbar");
|
.prependTo(".red-ui-header-toolbar");
|
||||||
|
@ -143,4 +143,19 @@ describe("api/editor/theme", function () {
|
|||||||
settings.projects.should.have.a.property("enabled", false);
|
settings.projects.should.have.a.property("enabled", false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("test explicit userMenu set to true in theme setting", function () {
|
||||||
|
theme.init({
|
||||||
|
editorTheme: {
|
||||||
|
userMenu: true,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
theme.app();
|
||||||
|
|
||||||
|
var settings = theme.settings();
|
||||||
|
settings.should.have.a.property("userMenu");
|
||||||
|
settings.userMenu.should.be.eql(true);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user