editor: holding alt extends the north-west handle to the widget's size to ease dragging

image: broken value validation
This commit is contained in:
bordun 2020-10-02 18:18:55 +02:00
parent 248e51b615
commit 55ab033b94
5 changed files with 27 additions and 4 deletions

View file

@ -2,9 +2,15 @@
## 1.4.2
- bug fixes
- image: broken value validation
- editor
- holding `alt` extends the north-west handle to the widget's size to ease dragging
- widgets
- remove `colorBg` for all widgets except containers
- widgets background color is now transparent by default (can be overridden with css)
- widgets background color is now transparent by default (can be overridden with css)
## 1.4.1

View file

@ -46,11 +46,10 @@ The project tree displays the whole widget structure of the session. Widgets can
## Widget resizing / dragging
Selected widget can be resized using its south, south-east and east handles. It can be dragged with its north-west handle. If the widget's position/size was written in percents, the editor will try to keep using percents.
Selected widget can be resized using its south, south-east and east handles. It can be dragged with its north-west handle (holding ++alt++ extends this handle to the widget's size to ease dragging). If the widget's position/size was written in percents, the editor will try to keep using percents.
When the grid is enabled, widget resizing / dragging snaps to a 10 pixel wide grid.
## Multi-widgets editing
Multiple widgets can be edited at once.

View file

@ -1,4 +1,5 @@
var UiWidget = require('./ui-widget'),
keyboardJS = require('keyboardjs/dist/keyboard.min.js'),
html = require('nanohtml'),
Tab, Root
@ -101,6 +102,14 @@ class UiDragResize extends UiWidget {
// this.handles[0]._ignore_css_transforms = true
keyboardJS.withContext('editing', ()=>{
keyboardJS.bind('alt', (e)=>{
this.handles[0].classList.add('full')
}, (e)=>{
this.handles[0].classList.remove('full')
})
})
}
clear() {

View file

@ -55,7 +55,7 @@ module.exports = class Image extends StaticProperties(Widget, {bypass: true}) {
setValue(v, options={}) {
if (typeof this.value !== 'string') return
if (typeof v !== 'string') return
var s = v==null ? '' : '' + v,
cache_query = ''

View file

@ -86,6 +86,15 @@
}
&.full {
width: var(--width);
height: var(--height);
top: 0;
left: 0;
opacity: 0.1;
z-index: 1;
margin:0;
}
}
}