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

@ -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 = ''