浏览代码

HUE-5284 [notebook] Reset snippet status when switching its type

Romain Rigaux 9 年之前
父节点
当前提交
5d5a5aa
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

+ 3 - 0
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -260,6 +260,9 @@ var EditorViewModel = (function() {
     self.id = ko.observable(typeof snippet.id != "undefined" && snippet.id != null ? snippet.id : UUID());
     self.name = ko.observable(typeof snippet.name != "undefined" && snippet.name != null ? snippet.name : '');
     self.type = ko.observable(typeof snippet.type != "undefined" && snippet.type != null ? snippet.type : 'hive');
+    self.type.subscribe(function(newVal) {
+      self.status('ready');
+    });
 
     self.isBatchable = ko.computed(function() {
       return self.type() == 'hive'