From 5a75c6ef2f9f128dc8d15c0d218704460a12ef79 Mon Sep 17 00:00:00 2001 From: Marc Wouts Date: Thu, 13 Jun 2019 17:13:56 +0200 Subject: [PATCH] Update entries in the Jupytext menu on hover Fix #248 --- HISTORY.rst | 2 +- jupytext/nbextension/index.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 4e50b37bc..7b42cfb7c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -14,7 +14,7 @@ Release History **BugFixes** - The Jupytext Menu in Jupyter Notebook is now compatible with ``jupyter_nbextensions_configurator`` (#178) - +- Entries in the Jupytext menu are updated when the menu is hovered on (#248) 1.1.6 (2019-06-11) ++++++++++++++++++++++ diff --git a/jupytext/nbextension/index.js b/jupytext/nbextension/index.js index 031b94c88..bc24d8245 100644 --- a/jupytext/nbextension/index.js +++ b/jupytext/nbextension/index.js @@ -78,6 +78,11 @@ define([ checkAutosave(); } + function updateJupytextMenu() { + checkSelectedJupytextFormat(); + checkAutosave(); + } + function jupytext_pair(formats, text) { return $('
  • ').append($('') .attr('id', 'jupytext_pair_' + formats.replace(':', '_').replace(',', '_')) @@ -102,7 +107,8 @@ define([ .attr('data-toggle', 'dropdown') .attr('aria-expanded', 'false') .text('Jupytext') - .attr('title', 'Jupyter notebooks as Markdown documents, Julia, Python or R scripts'); + .attr('title', 'Jupyter notebooks as Markdown documents, Julia, Python or R scripts') + .on('mouseover', updateJupytextMenu); var JupytextActions = $('
      ') .attr('id', 'jupytext_actions')