Skip to content

Commit 03b4e32

Browse files
committed
Merge pull request #992 from minrk/open-dirty
use _.isEqual to check for metadata changes
2 parents fc8d0dc + 36ab085 commit 03b4e32

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

notebook/static/notebook/js/notebook.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ define(function (require) {
88
"use strict";
99
var IPython = require('base/js/namespace');
1010
var $ = require('jquery');
11+
var _ = require('underscore');
1112
var utils = require('base/js/utils');
1213
var dialog = require('base/js/dialog');
1314
var cellmod = require('notebook/js/cell');
@@ -245,7 +246,7 @@ define(function (require) {
245246
display_name: data.spec.display_name,
246247
language: data.spec.language,
247248
};
248-
if (!existing_spec || JSON.stringify(existing_spec) != JSON.stringify(that.metadata.kernelspec)) {
249+
if (!existing_spec || ! _.isEqual(existing_spec, that.metadata.kernelspec)) {
249250
that.set_dirty(true);
250251
}
251252
// start session if the current session isn't already correct
@@ -263,7 +264,7 @@ define(function (require) {
263264
var existing_info = that.metadata.language_info;
264265
var langinfo = kinfo.language_info;
265266
that.metadata.language_info = langinfo;
266-
if (!existing_info || JSON.stringify(existing_info) != JSON.stringify(langinfo)) {
267+
if (!existing_info || ! _.isEqual(existing_info, langinfo)) {
267268
that.set_dirty(true);
268269
}
269270
// Mode 'null' should be plain, unhighlighted text.

0 commit comments

Comments
 (0)