modal: edit mode glitch fix

This commit is contained in:
jean-emmanuel 2017-06-02 16:40:10 +02:00
parent 33728ea10a
commit c5c71aa0a6
4 changed files with 37 additions and 19 deletions

View file

@ -1,5 +1,14 @@
# Changelog
## next
- widgets
- add property inheritance between widgets through `@{parent.propertyName}` statements;
- containers: added `variables` options (arbitrary varibles to pass to children)
- modal: changed style to fit popups' appearance; added `popupWidth` and `popupHeight` options
- custom module
- add access to the app's `settings` object
## 0.17.8
- bug fixes

View file

@ -21,7 +21,7 @@ module.exports = class Modal extends _widgets_base {
color:'auto',
css:'',
_layout:'popup',
_popup:'popup',
popupWidth:'100%',
popupHeight:'100%',
@ -73,8 +73,8 @@ module.exports = class Modal extends _widgets_base {
this.light = $('<div class="light"></div>').appendTo(this.container)
this.light.on('fake-click',(e)=>{
if (e.type != 'fake-right-click')
this.setValue(!this.value)
if (e.button != 2)
this.setValue(!this.value)
})
this.parentScroll = [0,0]
@ -87,20 +87,19 @@ module.exports = class Modal extends _widgets_base {
this.value = v ? true : false
if (!this.init) {
this.widget.find('.popup-title .popup-label').html(this.container.find('> .label span').html())
this.init = true
}
if (!this.init) this.widget.find('.popup-title .popup-label').html(this.container.find('> .label span').html())
this.widget.toggle(this.value)
this.container.toggleClass('on', this.value)
this.fixScrolling()
if (this.value) $(window).resize()
this.fixStacking()
if (this.value) {
$(window).resize()
}
if (!this.init || this.value == true) this.fixStacking()
if (!this.init) this.init = true
}
fixScrolling(){
@ -114,6 +113,7 @@ module.exports = class Modal extends _widgets_base {
}
fixStacking() {
console.log(this.value, this.container.parents('.widget'))
if (this.value) {
this.container.parents('.widget').css('z-index','initial')
} else {

View file

@ -390,10 +390,10 @@ i {
&:before {
content: "";
position: absolute;
top:0;
left:0;
right:0;
bottom:0;
top:-40rem;
left:-40rem;
right:-40rem;
bottom:-40rem;
background:var(--color-bg);
opacity: .5;
}
@ -403,6 +403,7 @@ i {
background:var(--color-light-fg);
border-bottom: 1rem solid var(--color-bg);
box-shadow: 0 1rem 0 0 var(--color-light) inset;
height:46rem;
&.closable {
padding-right: 50rem;
@ -425,7 +426,9 @@ i {
margin:0 auto;
position: relative;
overflow: hidden;
border:1rem solid var(--color-track);
box-shadow: 0.5rem 0.5rem 0 0.5rem var(--color-bg), 0 1rem 0 0 var(--color-light) inset;
border-left:1rem solid var(--color-bg);
border-top:1rem solid var(--color-bg);
.popup-content {
height:100%;
width:100%;

View file

@ -94,6 +94,7 @@
top:0;
}
> .popup {
padding:0;
> .popup-wrapper {
max-width: 100%;
max-height: 100%;
@ -104,13 +105,18 @@
background: transparent;
> .panel {
background-color: var(--color-fg);
position: relative;
width: 100%;
height:100%;
top:-1rem;
position: absolute;
width: auto;
height: auto;
top:45rem;
left:-1rem;
right:-1rem;
bottom:-1rem;
}
}
.popup-title {
z-index: 1;
}
}
}
&.editing .popup-wrapper:after {