zz9pa
5 Dec 2019, 8:48 AM
Hi
I've got a set of window that are constrained to a panel - and I can move them about without any issues.
I can set
resizable: {
target: this,
handles: 'all',
dynamic: true,
heightIncrement:50,
widthIncrement: 50
},
on the window - and it will only resize in chunks of 50 pixels
What I'd really like is to limit where the window can be dropped so it sits on that same 50x50 grid.
I thought I could do it with something like
draggable: {
constrain: {
snap: {
x: me.snapToGrid,
y: me.snapToGrid
}
}
}
but that doesn't seem to be available to a Window.
I've tried various ways of doing it in the "move" event handler - but I'm having issues with the "Y" position (not relative to the panel maybe?)
Any thoughts on how I can get the window to "snap" move as well as resize ?
I've got a set of window that are constrained to a panel - and I can move them about without any issues.
I can set
resizable: {
target: this,
handles: 'all',
dynamic: true,
heightIncrement:50,
widthIncrement: 50
},
on the window - and it will only resize in chunks of 50 pixels
What I'd really like is to limit where the window can be dropped so it sits on that same 50x50 grid.
I thought I could do it with something like
draggable: {
constrain: {
snap: {
x: me.snapToGrid,
y: me.snapToGrid
}
}
}
but that doesn't seem to be available to a Window.
I've tried various ways of doing it in the "move" event handler - but I'm having issues with the "Y" position (not relative to the panel maybe?)
Any thoughts on how I can get the window to "snap" move as well as resize ?