Skip to content

Commit c44b228

Browse files
authored
Merge pull request #149 from juhasch/fix/versions
Use sys_info.notebook_version to get notebook version
2 parents af0845c + 6ca7c85 commit c44b228

File tree

1 file changed

+4
-3
lines changed
  • src/jupyter_nbextensions_configurator/static/nbextensions_configurator

1 file changed

+4
-3
lines changed

src/jupyter_nbextensions_configurator/static/nbextensions_configurator/main.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ define([
167167
console.log(log_prefix, state ? ' enabled' : 'disabled', extension.require);
168168
// for pre-4.2 versions, the javascript loading nbextensions actually
169169
// ignores the true/false state, so to disable we have to delete the key
170-
if ((version_compare(Jupyter.version, '4.2') < 0) && !state) {
170+
if ((version_compare(((typeof sys_info === 'undefined') ? Jupyter.version : sys_info.notebook_version),
171+
'4.2') < 0) && !state) {
171172
state = null;
172173
}
173174
var to_load = {};
@@ -935,7 +936,7 @@ define([
935936
// Compatibility
936937
var compat_txt = extension.Compatibility || '?.x';
937938
var compat_idx = compat_txt.toLowerCase().indexOf(
938-
Jupyter.version.substring(0, 2) + 'x');
939+
((typeof sys_info === 'undefined') ? Jupyter.version : sys_info.notebook_version).substring(0, 2) + 'x');
939940
if (!extension.is_compatible) {
940941
ext_row.addClass('nbext-incompatible');
941942
compat_txt = $('<span/>')
@@ -1436,7 +1437,7 @@ define([
14361437
console.log(log_prefix, 'Found nbextension', extension.require);
14371438

14381439
extension.is_compatible = (extension.Compatibility || '?.x').toLowerCase().indexOf(
1439-
Jupyter.version.substring(0, 2) + 'x') >= 0;
1440+
((typeof sys_info === 'undefined') ? Jupyter.version : sys_info.notebook_version).substring(0, 2) + 'x') >= 0;
14401441
extension.Parameters = extension.Parameters || [];
14411442
if (!extension.is_compatible) {
14421443
// reveal the checkbox since we've found an incompatible nbext

0 commit comments

Comments
 (0)