editor: separate editor menu from the actual editor form

This commit is contained in:
jean-emmanuel 2017-04-20 00:10:33 +02:00
parent 117c7cdd95
commit 8f5a594464
4 changed files with 48 additions and 44 deletions

View file

@ -143,7 +143,7 @@ module.exports = {
document.documentElement.style.setProperty("--grid-width",GRIDWIDTH)
})
})
$('.editor').append(f)
$('.editor-menu').append(f)
},
editorDisable: function(){
$('.widget.ui-resizable').resizable('destroy')
@ -158,8 +158,8 @@ module.exports = {
EDITING = false
if (READ_ONLY) {
module.exports.editorEnable = ()=>{}
$('.editor .btn').remove()
$('.editor .title').html($('.editor .title').html() + ' (disabled)').addClass('disabled')
$('.editor-menu .btn').remove()
$('.editor-menu .title').html($('.editor-menu .title').html() + ' (disabled)').addClass('disabled')
}
},
traversingDisable: function(){

View file

@ -26,7 +26,7 @@ var editObject = function(container, data, refresh){
$(container).parent().addClass('editing')
}
$('.editor').append('<div class="editor-container"></div>')
$('#editor').append('<div class="editor-container"></div>')
var form = $('<div class="form"></div>').appendTo('.editor-container')
@ -276,7 +276,7 @@ var editSession = function(container,data,refresh){
$('.editor-root, #container').addClass('editing')
$('.editor').append('<div class="editor-container"></div>')
$('#editor').append('<div class="editor-container"></div>')
var form = $('<div class="form"></div>').appendTo('.editor-container')

View file

@ -54,7 +54,7 @@ var data = [
},
{
title: icon('edit') + '&nbsp; Editor',
class:'editor',
class:'editor-menu',
actions: [
{
title:'On',
@ -148,6 +148,7 @@ module.exports = {
<div class="navigation"><ul><li><a>${PACKAGE.productName.toUpperCase()}</a></li></ul></div>
`)
$('#sidepanel').append(sidepanel)
$('#sidepanel').append('<div id="editor"></div>')
toggle()
},
createToggle:toggle

View file

@ -38,50 +38,53 @@
}
#options {
position:absolute;
left:8rem;
right:8rem;
list-style:none;
margin-bottom: 1px;
padding-bottom: 8rem;
padding: 8rem;
margin-bottom: 1rem
}
li {
display:block;
margin-bottom:8rem;
position: relative;
#editor {
box-shadow: 0 2rem 0 0 var(--color-bg) inset, 0 3rem 0 0 var(--color-light) inset;
padding: 1rem 8rem 8rem;
&:empty {
padding:0;
}
}
&:last-child {
margin: 0;
li {
display:block;
margin-bottom:8rem;
position: relative;
&:last-child {
margin: 0;
}
.btn + span {
position: absolute;
right:0rem;
top:0rem;
padding:8rem;
color:var(--color-text-fade);
&:hover {
color:var(--color-text);
}
.btn + span {
position: absolute;
right:0rem;
top:0rem;
padding:8rem;
color:var(--color-text-fade);
&:hover {
color:var(--color-text);
}
}
ul {
padding: 4rem;
li {
margin-bottom: 4rem;
}
}
}
.editor .form {
margin-top: 10rem;
}
.help {
margin-top:10rem;
font-size: .75em;
text-align: center;
font-style: italic;
ul {
padding: 4rem;
li {
margin-bottom: 4rem;
}
}
}
#editor .form {
margin-top: 10rem;
}
.help {
margin-top:10rem;
font-size: .75em;
text-align: center;
font-style: italic;
}
}
.actions {