diff --git a/lib/features/label-editing/LabelEditingProvider.js b/lib/features/label-editing/LabelEditingProvider.js index fbb68a49..db1948a7 100644 --- a/lib/features/label-editing/LabelEditingProvider.js +++ b/lib/features/label-editing/LabelEditingProvider.js @@ -40,29 +40,37 @@ function LabelEditingProvider(eventBus, canvas, directEditing, commandStack, res directEditing.cancel(); }); - if ('ontouchstart' in document.documentElement) { - // we deactivate automatic label editing on mobile devices + + eventBus.on('directEditing.activate', function(event) { + resizeHandles.removeResizers(); + }); + + eventBus.on('create.end', 500, function(event) { + + var element = event.shape, + canExecute = event.context.canExecute, + isTouch; + + // TODO(nikku): we need to find a way to support the direct editing + // on mobile devices; right now this will break for desworkflowediting on mobile devices // as it breaks the user interaction workflow // TODO(nre): we should temporarily focus the edited element here // and release the focused viewport after the direct edit operation is finished - } else { - eventBus.on('create.end', 500, function(event) { - var element = event.shape, - canExecute = event.context.canExecute; + if (isTouch) { + return; + } - if (!canExecute) { - return; - } + if (!canExecute) { + return; + } - if (is(element, 'bpmn:Task') || is(element, 'bpmn:TextAnnotation') || - (is(element, 'bpmn:SubProcess') && !isExpanded(element))) { - directEditing.activate(element); + if (is(element, 'bpmn:Task') || is(element, 'bpmn:TextAnnotation') || + (is(element, 'bpmn:SubProcess') && !isExpanded(element))) { + directEditing.activate(element); + } + }); - resizeHandles.removeResizers(); - } - }); - } } LabelEditingProvider.$inject = [ 'eventBus', 'canvas', 'directEditing', 'commandStack', 'resizeHandles' ];