mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-24 00:35:26 +03:00
Fix single line drag drop.
This commit is contained in:
parent
39cf5bc9cc
commit
317ee20dc8
1 changed files with 11 additions and 5 deletions
|
@ -1431,13 +1431,19 @@ OSD.GUI.preview = {
|
|||
onDrop: function(e) {
|
||||
var ev = e.originalEvent;
|
||||
|
||||
var position = $(this).removeAttr('style').data('position');
|
||||
var field_id = parseInt(ev.dataTransfer.getData('text/plain'))
|
||||
var x = parseInt(ev.dataTransfer.getData('x'))
|
||||
var y = parseInt(ev.dataTransfer.getData('y'))
|
||||
position -= x;
|
||||
position -= (y * FONT.constants.SIZES.LINE)
|
||||
var display_item = OSD.data.display_items[field_id];
|
||||
var position = $(this).removeAttr('style').data('position');
|
||||
|
||||
if (display_item.preview.constructor === Array) {
|
||||
console.log('Initial Drop Position: ' + position);
|
||||
var x = parseInt(ev.dataTransfer.getData('x'))
|
||||
var y = parseInt(ev.dataTransfer.getData('y'))
|
||||
console.log('XY Co-ords:' + x + '-' + y);
|
||||
position -= x;
|
||||
position -= (y * FONT.constants.SIZES.LINE)
|
||||
console.log('Calculated Position: ' + position);
|
||||
}
|
||||
|
||||
var overflows_line = 0;
|
||||
// Standard preview, string type
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue