editor: attempt to get a consistent key scheme
This commit is contained in:
parent
af98cd5452
commit
d69994e15a
3 changed files with 5 additions and 5 deletions
|
|
@ -47,7 +47,7 @@ Selected widget can be resized using its south, south-east and east handles. It
|
|||
|
||||
## Bulk editing
|
||||
|
||||
When holding the `ctrl` key (or `command` on Mac), multiple widgets can be selected for edition by dragging the mouse or clicking on each widget individually.
|
||||
When holding `shift`, the mouse can be used to select multiple widgets in a *click & drag* gesture. When holding `ctrl` (or `command` on Mac), multiple widgets can be selected for edition.
|
||||
|
||||
- they must share the same parent widget
|
||||
- context-menu actions and properties changes apply to all selected widgets
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ var {updateWidget} = require('./data-workers'),
|
|||
locales = require('../locales')
|
||||
|
||||
|
||||
var multiSelectKey = (navigator.platform || '').match('Mac') ? 'shiftKey' : 'ctrlKey'
|
||||
var multiSelectKey = (navigator.platform || '').match('Mac') ? 'metaKey' : 'ctrlKey'
|
||||
|
||||
|
||||
class ContextMenu {
|
||||
|
|
@ -122,7 +122,7 @@ var handleClick = function(event) {
|
|||
|
||||
if (contextMenu.menu && !contextMenu.menu.contains(event.target)) contextMenu.close()
|
||||
|
||||
if (!event.detail.ctrlKey && event.type !== 'fast-right-click' && (
|
||||
if (!event.detail.shiftKey && event.type !== 'fast-right-click' && (
|
||||
event.target.classList.contains('ui-resizable-handle') ||
|
||||
event.target.classList.contains('ui-draggable-handle') ||
|
||||
event.target.id === 'open-toggle'
|
||||
|
|
@ -149,7 +149,7 @@ var handleClick = function(event) {
|
|||
// right-click menu
|
||||
if (event.type !== 'fast-right-click') return
|
||||
|
||||
if (!event.detail.ctrlKey && editor.selectedWidgets.length <= 1) {
|
||||
if (!event.detail.shiftKey && editor.selectedWidgets.length <= 1) {
|
||||
editor.select(widget, {multi: event.detail[multiSelectKey]})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class SelectArea {
|
|||
}
|
||||
|
||||
mousedown(e) {
|
||||
if (!e.ctrlKey) return
|
||||
if (!e.shiftKey) return
|
||||
this.startX = this.curX = e.clientX
|
||||
this.startY = this.curY = e.clientY
|
||||
this.down = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue