calc: don't make app inactive on drag and drop

When Pivot table dialog was used and we drag and drop
elements from list to other list in Firefox - then
we sent userinactive message because we lost focus of
a window. Don't do that.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I03f1b8a72e4f318034569d4fffe496f32c5a8a51
This commit is contained in:
Szymon Kłos 2023-12-20 19:22:38 +01:00 committed by Szymon Kłos
parent fa87fb803e
commit 78a4ed13ff
2 changed files with 9 additions and 2 deletions

View file

@ -781,3 +781,8 @@ JSDialog.treeView = function (parentContainer, data, builder) {
var buildInnerData = _treelistboxControl(parentContainer, data, builder);
return buildInnerData;
};
JSDialog.isDnDActive = function () {
var dndElements = document.querySelectorAll('.droptarget');
return (dndElements && dndElements.length);
};

View file

@ -3,7 +3,7 @@
* L.Map is the central class of the API - it is used to create a map.
*/
/* global app _ Cursor */
/* global app _ Cursor JSDialog */
L.Map = L.Evented.extend({
@ -1387,7 +1387,9 @@ L.Map = L.Evented.extend({
// Our browser tab lost focus.
_onLostFocus: function () {
app.idleHandler._deactivate();
// don't deactivate view while Drag and Drop in Pivot table dialog
if (!JSDialog.isDnDActive())
app.idleHandler._deactivate();
},
// The editor got focus (probably a dialog closed or user clicked to edit).