Product Ideas

Create Mark Drag Event To Hook To

PrizmDoc should include a MarkDrag Event similar to the events we currently have MarkCreated, MarkChanged

  • Garrett Krotee
  • Sep 29 2016
  • Will not implement
  • Attach files
  • Mark Fears commented
    31 Jan, 2018 09:20pm

    From the customer's description, it sounds like the customer just needs to know when the user has moved or resized a mark. And they are currently using the click event, but this is not ideal because it fires after the user moves a mark but also when the user just clicks a mark.

    With the existing product functionality, the customer can solve their issue by debouncing the viewer control MarkChanged event, as demonstrated in the code below. We could update the viewer control API to add API to provide more info when the user moves the mouse or drags a mark, but in my view it is not worth making the API more complex, especially since there is already a good solution with the existing API (see below). We already trigger a MarkChanged event (which notifies that the rectangle property has changed), and it seems redundant and overly complicated to also fire a MarkDragged event since we would then have two separate events with similar and overlapping purposes.

    var timeout;
    var onMarkChanged = function() {
    // This will only execute when the user stops moving the mark.
    console.log('mark changed');
    };
    var debounceMarkChanged = function() {
    if (timeout) {
    clearTimeout(timeout);
    }
    timeout = setTimeout(onMarkChanged, 50);
    };
    viewer.viewerControl.on('MarkChanged', debounceMarkChanged);
  • Mark Fears commented
    10 Nov, 2017 07:15pm
    The dev team is looking into your request and wanted to know if you could provide your use case so they understand what you are needing to accomplish with a Mark Drag event.

    It's possible that our existing API might support it, for example, perhaps the mouse down/move/up events of ViewerControl could be used.