mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Make sidebars disabled-on-edit by default
This commit is contained in:
parent
ada1e624d8
commit
64722da4a7
@ -24,13 +24,13 @@ RED.sidebar = (function() {
|
||||
if (tab.onchange) {
|
||||
tab.onchange.call(tab);
|
||||
}
|
||||
$(tab.content).show();
|
||||
$(tab.wrapper).show();
|
||||
if (tab.toolbar) {
|
||||
$(tab.toolbar).show();
|
||||
}
|
||||
},
|
||||
onremove: function(tab) {
|
||||
$(tab.content).hide();
|
||||
$(tab.wrapper).hide();
|
||||
if (tab.onremove) {
|
||||
tab.onremove.call(tab);
|
||||
}
|
||||
@ -58,15 +58,18 @@ RED.sidebar = (function() {
|
||||
options = title;
|
||||
}
|
||||
|
||||
options.wrapper = $('<div>',{style:"height:100%"}).appendTo("#sidebar-content")
|
||||
options.wrapper.append(options.content);
|
||||
options.wrapper.hide();
|
||||
|
||||
if (!options.enableOnEdit) {
|
||||
options.shade = $('<div>',{class:"sidebar-shade hide"}).appendTo(options.wrapper);
|
||||
}
|
||||
|
||||
$("#sidebar-content").append(options.content);
|
||||
$(options.content).hide();
|
||||
if (options.toolbar) {
|
||||
$("#sidebar-footer").append(options.toolbar);
|
||||
$(options.toolbar).hide();
|
||||
}
|
||||
$(options.content).hide();
|
||||
var id = options.id;
|
||||
|
||||
RED.menu.addItem("menu-item-view-menu",{
|
||||
@ -87,7 +90,10 @@ RED.sidebar = (function() {
|
||||
|
||||
function removeTab(id) {
|
||||
sidebar_tabs.removeTab(id);
|
||||
$(knownTabs[id].content).remove();
|
||||
$(knownTabs[id].wrapper).remove();
|
||||
if (knownTabs[id].footer) {
|
||||
knownTabs[id].footer.remove();
|
||||
}
|
||||
delete knownTabs[id];
|
||||
RED.menu.removeItem("menu-item-view-menu-"+id);
|
||||
}
|
||||
|
@ -35,9 +35,6 @@ RED.sidebar.config = (function() {
|
||||
var flowCategories = $("<div>").appendTo(content);
|
||||
var subflowCategories = $("<div>").appendTo(content);
|
||||
|
||||
|
||||
var shade = $('<div class="sidebar-node-config-shade hide"></div>').appendTo(content);
|
||||
|
||||
var showUnusedOnly = false;
|
||||
|
||||
var categories = {};
|
||||
@ -291,12 +288,6 @@ RED.sidebar.config = (function() {
|
||||
return {
|
||||
init:init,
|
||||
show:show,
|
||||
refresh:refreshConfigNodeList,
|
||||
disable: function() {
|
||||
shade.show();
|
||||
},
|
||||
enable: function() {
|
||||
shade.hide();
|
||||
}
|
||||
refresh:refreshConfigNodeList
|
||||
}
|
||||
})();
|
||||
|
@ -39,7 +39,8 @@ RED.sidebar.info = (function() {
|
||||
id: "info",
|
||||
label: RED._("sidebar.info.label"),
|
||||
name: RED._("sidebar.info.name"),
|
||||
content: content
|
||||
content: content,
|
||||
enableOnEdit: true
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -99,7 +99,8 @@ RED.tray = (function() {
|
||||
|
||||
$("#header-shade").show();
|
||||
$("#editor-shade").show();
|
||||
RED.sidebar.config.disable();
|
||||
$(".sidebar-shade").show();
|
||||
|
||||
tray.preferredWidth = Math.max(el.width(),500);
|
||||
body.css({"minWidth":tray.preferredWidth-40});
|
||||
|
||||
@ -235,8 +236,7 @@ RED.tray = (function() {
|
||||
if (stack.length === 0) {
|
||||
$("#header-shade").hide();
|
||||
$("#editor-shade").hide();
|
||||
RED.sidebar.config.enable();
|
||||
|
||||
$(".sidebar-shade").hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -95,3 +95,12 @@
|
||||
.sidebar-header-button:not(:first-child) {
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
.sidebar-shade {
|
||||
position: absolute;
|
||||
top:0;
|
||||
bottom:0;
|
||||
left:0;
|
||||
right:0;
|
||||
background: $shade-color;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2015 IBM Corp.
|
||||
* Copyright 2015, 2016 IBM Corp.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -21,15 +21,6 @@
|
||||
overflow-y:auto;
|
||||
@include disable-selection;
|
||||
}
|
||||
.sidebar-node-config-shade {
|
||||
position: absolute;
|
||||
top:0;
|
||||
bottom:0;
|
||||
left:0;
|
||||
right:0;
|
||||
background: $shade-color;
|
||||
}
|
||||
|
||||
|
||||
.config-node-list {
|
||||
margin: 0;
|
||||
|
@ -143,7 +143,8 @@
|
||||
id: "debug",
|
||||
label: this._("debug.sidebar.label"),
|
||||
name: this._("debug.sidebar.name"),
|
||||
content: content
|
||||
content: content,
|
||||
enableOnEdit: true
|
||||
});
|
||||
|
||||
function getTimestamp() {
|
||||
|
Loading…
Reference in New Issue
Block a user