Show context menu only on specific item-click

Hi All,
I am designing an HTML extension for InDesign CC 2014 for Win and Mac. I have been successful in displaying a context menu using CEPInterface 5.2
Below is the code,
function CreateContextMenu() {
  csInterface.setContextMenu(contextMenuXML, contextMenuClickedHandler);
This function is called when user right-clicks inside a box. The problem I am facing is that once I set the context menu, no matter where I right-click inside the panel, the context menu is created. Can I set it so that the context menu is shown only when I click inside the box?
Thanks!

Hi,
I have no idea whether this would work, but how about a 'click' listener on the body element with Event.stopPropagation() or preventDefault(); then check the event target, and if it's the element you want, then yourElement.dispatchEvent(new Event('click')) ?
See refs here: Creating and triggering events - Web developer guide | MDN and Event.stopPropagation() - Web API Interfaces | MDN
Just a suggestion, let me know if this helps
Regards
Davide Barranca
www.davidebarranca.com
www.cs-extensions.com

Similar Messages

  • Logitech Mouse - Right-click won't show context menu - only app switcher

    I use a Logitech MX 600 mouse. In LCC, I've set the Right Button to Click as the assigned action and Right Click as the action performed. When I click the right button, it shows the app switcher.
    I can see the context menu if I Control - Right Click.
    As an experiment, I programmed the Thumb Back Button to Click and the action performed as Right Click and it also shows the app switcher.
    In this mode, I can see the Context Menu if I Control - Thumb Back Button.
    I'd like to see the context menu with Right Click without holding down Control.
    I'm running Tiger with Logitech LCC software.
    Thanks,
    bg

    Get rid of LCC and use SteerMouse instead - VersionTracker or MacUpdate.

  • When I move mouse on Firefox-History (it must show context menu) he just begins to think, and after ~20 seconds he looks like I haven't pressed any buttons! I tried to turn off all addons but it doesn't help. Also he "thinks" everytime when gets download

    when I move mouse on Firefox-History (it must show context menu) he just begins to think, and after ~20 seconds he looks like I haven't pressed any buttons! I tried to turn off all addons but it doesn't help. Also he "thinks" everytime when he gets new downloading and sometimes on pushing Bookmarks

    Try running Firefox in [[Safe Mode]]. If it functions properly in that configuration, then one of your add-ons is the culprit.

  • Magic Mouse continually shows context menu on all mouse clicks

    Periodically the magic mouse gets into a mode where all mouse clicks result in the context menu appearing.
    I can't even double click on a application to open.
    I can sometimes get the behavior to stop by rebooting the machine (but not always).  And there are times if I keep banging on the keyboard in a text entry area the all context menu all teh time behavior will stop.
    Originally I thought it was just a magic mouse problem, but I see the same behavior if I swap it out with an old tethered mouse.  Any ideas?
    Thanks

    It sounds like the Control/alt key may be stuck down.  The CNTL click is another way to perform secondary click.
    You can check for that by starting the Keyboard viewer.  System Preferences > Keyboard > Keyboard tab > check "Show Keyboard and character viewer in the menubar".  Then click the icon in the menubar and start the Keyboard viewer. Any pressed keys will be reflected.
    Regards,
    Captfred

  • Is it possible to create a Visual Studio plugin that can copy TFS work item ID by adding a context menu in the work item UI?

    Our team is using VS2013 and TFS 2013, and in our daily work we often open a TFS query, then we need to open a work item, and we often need to copy the ID, for example, to the email.
    But currently the field is read only, and we often manually copy it.
    So is there any convenient way to solve this? Any built in ways?
    If no, is it possible to create such a plugin?
    Regards,
    Lei Yang
    from Motorolasolutions

    Hi Lei Yang
    You can try the following work around to copy work item ID
    for VS 2013:
    Right click on work item tab header in VS 2013 and click 'Copy Full Path' from context menu
    When you paste it on notepad/email you will get work item ID at the end of the path:
    http://sumiran-dev:8080/tfs/web/wi.aspx?pcguid=d855bc22-69a8-45a5-b6fc-25f096ade8f5&id=46
    For Web Portal:
    Right click on work item link at top and click 'Copy shortcut' from the context menu
    When you paste it on notepad/email you will get work item ID at the end of the shortcut:
    http://sumiran-dev:8080/tfs/DefaultCollection/TFS%20Scrum%20Demo/_workitems/edit/46
    Thanks
    Sumiran

  • Virtual keyboard's context-menu: can users add items to it?

    iPad's virtual keyboard has a context-menu: when you hold a finger down on the -a- key of the English keyboard, for example, a context-menu appears showing various accented/combining forms of the character -a- from which you can choose. Is there a way for users to add items to this context-menu? Could one add [ð] [u00F0, 'Latin eth'] to the [d] key's context-menu and [þ] [u00FE, 'Latin thorn'] to the [t] key's context-menu?

    Unless there is a keyboard language that already supports those characters, then no. You cannot add additional options to the built-in keyboard. There are apps that extend the keyboard, one in particular is the Wolfram Alpha app. While I don't know if it supports the characters you are looking for, it does have an extensive variable based keyboard for input in addition to the system keyboard.

  • How to Hide dropdown context menu (ECB?) for items in a list?

    Hi everyone,
    I don't know the appropriate way to name this thread. I'm sure there is a technical term but I'm not sure what it is. Instead, I will describe.
    In any list, when you hover over an item, a dropdown option appears with options like "View Item" "Edit Item" "Compliance Details", etc.
    I would like to completely hide this context menu from the user as it only confused novice users trying to use a simple discussion board. Any way to do this easily, and ideally without Designer?
    thanks
    david

    David,
    To remove this you need to change the column. By default SharePoint would have this column associated with the view to easily edit the item. 
    Step to remove:
    1) Go to list settings
    2) In list settings navigate to the "All Items" view or the current view you have under the view section.
    3) uncheck the column [Column Name](linked to item with edit menu)
    4) check/select the column [Column Name] (linked to item)

  • How to create a context menu which appears on right click

    Hello Experts,
    I want to create a context menu which should appear on the right click of a mouse anywhere on the screen.
    I have seen this functionality in one of the sap applications, and i guess this is an inbuild functionality in Webdynpro for ABAP but in WebDynpro Java i haven't found any such inbuild functionality.
    Does anybody have any idea about it ?
    Regards,
    Amol

    Context menus are not supported in NW04 and NW04s, they will be available in the next major release.
    Armin

  • Lightroom 5: AppleScript: action "AXShowMenu" in Smart Collection panel does not show context menu

    We are developing a simple automatization tool using Lightroom 5 (the newest version of the CC) using AppleScript.
    For some actions, we need the context menu in the Smart Collections panel, for example to import Smart Collection descriptions.
    According to the documentation and various sources on stackoverflow and elsewhere, AXShowMenu should bring up that menu.
    So far, I have not been able to make that context menu pop up.
    Using UIElementInspector and UI Browser, I located the element which does have the AXShowMenu action attached. Based on the code provided by UI Browser, I got the following script, which I run from the Applescript Editor:
    tell application "Adobe Photoshop Lightroom 5"
    activate
    tell application "System Events"
    tell process "Lightroom"
    set frontmost to true
    perform action 1 of static text "Smart Collections" of group 1 of row 11 of outline 1 of scroll area 1 of window 6
    delay 2
    end tell
    end tell
    end tell
    tell application "AppleScript Editor" to activate
    Note that if you try to recreate this, the number of the window as well as the number of the row may be different. Also, the last line is just convenience, and not really relevant for the code.
    In the Results window in AppleScript Editor, I have the following:
    perform action 1 of static text "Smart Collections" of group 1 of row 11 of outline 1 of scroll area 1 of window 6 of process "Lightroom"
    --> action "AXShowMenu" of static text "Smart Collections" of group 1 of row 11 of outline 1 of scroll area 1 of window 6 of application process "Adobe Photoshop Lightroom 5"
    which means that I did invoke the action.
    But … nothing happens.
    Any insight, workaround etc. is highly appreciated.
    Thanks in advance.

    Just for the records, I did ask the same question on Stackoverflow, and there I got an answer which does work. This solution uses a little Python program to really simulate mouse clicks.

  • Showing Sub-Totals only for Specific Column in PowerView

    Hi,
    Is there a way of showing the sub-totals only for specific columns in a PowerView Matrix?
    I am only aware of showing the sub-totals for all or non of the columns.
    Thanks and Regards,
    Justin

    Hi Justin,
    According to your description, you want to get sub-totals specific columns within columns group. Right?
    In this scenario, we can use IIF() function in expression to achieve your goal. The expression will only return the total value when the column value is a specific value, otherwise we can make it return nothing. Try the following expression:
    IIF(Fields!Column.Value="[specific value]",Sum(Fields!Total.Value),nothing)
    We have tested this scenario in our local environment. Here are screenshots for your reference:
    Reference:
    Expression Examples (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • T430 Right shift key showing context menu

    Hi,
    I just got a Lenovo T430 and after using for barely a month, i got this issue that makes me go crazy.
    The OS is windows 8.0 Pro.
    Anytime i press the right shift key or the Enter key, i get this context menu popping out, sometimes moving my cursor somewhere else and doing other crazy stuffs
    Please what is wrong?

    Might be a faulty keyboard or keyboard cable. Try reseating the keyboard?
    W520: i7-2720QM, Q2000M at 1080/688/1376, 21GB RAM, 500GB + 750GB HDD, FHD screen
    X61T: L7500, 3GB RAM, 500GB HDD, XGA screen, Ultrabase
    Y3P: 5Y70, 8GB RAM, 256GB SSD, QHD+ screen

  • Show alarms in only one specific calendar

    I've created an iCal alarm to run a saved Automator workflow every 15 minutes, every day, during certain hours, in a new calendar called iTunes Sync (the workflow creates a backup of my iTunes .xml to a remote NAS). Now the alarms appears on all of my calendars, not just the new one. How can I disable visibility of these alarms in my other calendars?

    Have you upgraded to the new MobileMe calendar? - if you haven't, you should, because the old syncing method will be terminated on Thursday. For more on this please see this post:
    FYI: Four days before old calendar sync switch-off
    Once you've done this, or if you already have: your MobileMe calendars appear in the sidebar under your MobileMe login name. You can move the iTunes Sync calendar to 'On My Mac':
    Select the calendar. From the File menu choose Export...>Export. An .ics file will be saved in your selected location.
    From the File menu choose New Calendar>On my Mac; name it iTunes Sync.
    Select this new calendar. From the File menu choose Import... - select your .ics file and when prompted choose to add it to this new calendar (make sure it's the On My Mac one, not the MobileMe one).
    When the calendar has been imported and you have checked it's OK, select the MobileMe version: control-click it and choose Delete.
    Now the calendar is purely local to your Mac and won't sync.

  • -8003 Error "Can't Empty Trash" only with specific item

    Tried to get rid of a folder for an applicaiton that I'd downloaded & installed on a trial basis, then decided not to buy.
    Any time I trash this folder with the app and related files, I get the "Can't Empty Trash -8003" error.
    If I remove that folder, I can empty the trash fine.
    Any ideas?
    (the download app is Extensis Portfolio 8.5)

    You could try using TrashIt!
    Here's a cnet article about -8003:
    Here's another discussion on the same topic.
    Here's a general article on solving trash problems.

  • Context menu for toolbox shows wrong menu

    when itunes is open, right-clicking on anything in the toolbar (the stuff with the little clock) results in the context menu for the whole toolbar coming up as well as the context menu for whatever i'm clicking on. unfortunately the toolbar one comes up on top so it's super annoying. however, if i wait for the tooltip to show up before right-clicking, it only shows the correct context menu. i think this is just a bug, but does anyone know a fix?

    Hi Peter,
    If you are using Enterprise Portal to publish those reports to be viewed by the user, i think ur problem may get solved in EP itself. Contact ur EP associate and find out whether it is possible to do this or not. Hope we can do it in that. Otherwise you need to write some JAVA code in WAD which helps in not getting the display as such.
    Assign points if this helps u...
    Regards,
    Koundinya Karanam.

  • No right click context menu on tabs, just the name of the site.

    When I right click on a tab, there is no context menu, only the name of the site. What happened to the options such as "close other tabs", etc.

    Try the Firefox SafeMode to see how it works there. <br />
    ''A troubleshooting mode, which disables most Add-ons.'' <br />
    ''(If you're not using it, switch to the Default Theme.)''
    * You can open the Firefox 4/5/6/7 SafeMode by holding the '''Shft''' key when you use the Firefox desktop or Start menu shortcut.
    * Or use the Help menu item, click on '''Restart with Add-ons Disabled...''' while Firefox is running. <br />
    ''Don't select anything right now, just use "Continue in SafeMode."''
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut (without the Shft key) to open it again.''
    If it is good in the Firefox SafeMode, your problem is probably caused by an extension, and you need to figure out which one. <br />
    http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes

Maybe you are looking for