Atalasoft
Welcome to Atalasoft Community Sign in | Join | Help
in

conditional contextMenuShow() when AnnotationRightClicked()?

Last post 22 Apr 2008, 10:36 AM by David Cilley. 3 replies.
Sort Posts: Previous Next
  •  29 Feb 2008, 12:31 PM 13367

    conditional contextMenuShow() when AnnotationRightClicked()?

    We are concentrating not burning images in our ASP.NET web app and have both rectangle annotation, as well as redaction - which is nothing more than a rectangledata that is black-filled and canMove/canResize false.

    The only problem I see at the moment is that you can right-click and delete the meant-to-be redaction.

    How can I conditionally test to show/hide the AnnoContextMenu in the ContextMenuShow() call?

    Thanks.

  •  11 Mar 2008, 11:00 AM 13461 in reply to 13367

    Re: conditional contextMenuShow() when AnnotationRightClicked()?

    You could use an if - else block and a tooltip to do this:

    On the server side, set all redaction tooltips to "redaction", and on the client side:

    function OnAnnotationRightClicked(e){
       if (e.annotation.getToolTip() != 'redaction'){
          // show menu
       }
       else{
          alert('not authorized');
       }
    }


    David Cilley
    My AJAX Imaging Blog
    Atalasoft Development Team
  •  21 Apr 2008, 3:54 PM 13724 in reply to 13461

    Re: conditional contextMenuShow() when AnnotationRightClicked()?

    OK that works cool.

    WebAnnotationViewer.getAnnotations()[i].getType(); seems to work also.

    Thanks.

  •  22 Apr 2008, 10:36 AM 13731 in reply to 13724

    Re: conditional contextMenuShow() when AnnotationRightClicked()?

    getType will always return the base type of the annotation.  So if you've inherited a TextData object and called it MyCoolTextData, it will return TextData.

    This could cause some confusion :)

     


    David Cilley
    My AJAX Imaging Blog
    Atalasoft Development Team
View as RSS news feed in XML