From 3c7c8812a4d384a9d9c1f276c2fe353289af666a Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Tue, 19 Sep 2017 11:46:19 -0400 Subject: [PATCH] tempplate strings and new lines --- frontend/src/Metamaps/Views/ContextMenu.js | 2 +- frontend/src/components/common/ContextMenu.js | 42 ++++++++++++------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/frontend/src/Metamaps/Views/ContextMenu.js b/frontend/src/Metamaps/Views/ContextMenu.js index 74fa1751..f1553706 100644 --- a/frontend/src/Metamaps/Views/ContextMenu.js +++ b/frontend/src/Metamaps/Views/ContextMenu.js @@ -98,7 +98,7 @@ const ContextMenu = { $.ajax({ type: 'GET', - url: '/topics/' + id + '/relative_numbers.json?network=' + topicsString, + url: `/topics/${id}/relative_numbers.json?network=${topicsString}`, success: successCallback, error: function() {} }) diff --git a/frontend/src/components/common/ContextMenu.js b/frontend/src/components/common/ContextMenu.js index 5ffc7755..e3649e5d 100644 --- a/frontend/src/components/common/ContextMenu.js +++ b/frontend/src/components/common/ContextMenu.js @@ -37,6 +37,8 @@ class ContextMenu extends Component { const { contextPos } = this.props let extraClasses = [] const position = {} + // TODO: make these dynamic values so that the ContextMenu can + // change height and still work properly const RIGHTCLICK_WIDTH = 300 const RIGHTCLICK_HEIGHT = 144 // this does vary somewhat, but we can use static const SUBMENUS_WIDTH = 256 @@ -79,8 +81,9 @@ class ContextMenu extends Component { hide = () => { const { contextHide } = this.props return
  • -
    Hide until refresh -
    Ctrl+H
    +
    + Hide until refresh +
    Ctrl+H
  • } @@ -91,8 +94,9 @@ class ContextMenu extends Component { return null } return
  • -
    Remove from map -
    Ctrl+M
    +
    + Remove from map +
    Ctrl+M
  • } @@ -103,7 +107,8 @@ class ContextMenu extends Component { return null } return
  • -
    Delete +
    + Delete
    Ctrl+D
  • } @@ -115,7 +120,8 @@ class ContextMenu extends Component { } return
  • contextCenterOn(contextNode.id)}> -
    Center this topic +
    + Center this topic
    Alt+E
  • } @@ -127,7 +133,8 @@ class ContextMenu extends Component { } return
  • contextPopoutTopic(contextNode.id)}> -
    Open in new tab +
    + Open in new tab
  • } @@ -137,19 +144,23 @@ class ContextMenu extends Component { return null } return
  • -
    Change permissions +
    + Change permissions
    • contextUpdatePermissions('commons')}> -
      commons +
      + commons
    • contextUpdatePermissions('public')}> -
      public +
      + public
    • contextUpdatePermissions('private')}> -
      private +
      + private
    @@ -163,7 +174,8 @@ class ContextMenu extends Component { return null } return
  • -
    Change metacode +
    + Change metacode
    { @@ -190,10 +202,12 @@ class ContextMenu extends Component { } return
  • -
    Reveal siblings +
    + Reveal siblings
    • contextFetchSiblings(contextNode)}>All + onClick={() => contextFetchSiblings(contextNode)}> + All
      Alt+R
    • {contextSiblingsData && Object.keys(contextSiblingsData).map(key => {