[editor] Don't publish snippet changes from the history panel
@@ -565,10 +565,12 @@ class EditorViewModel {
if (typeof skipUrlChange === 'undefined' && !self.isNotificationManager()) {
if (self.editorMode()) {
self.editorType(data.document.type.substring('query-'.length));
+ if (!self.isNotificationManager()) {
huePubSub.publish('active.snippet.type.changed', {
type: self.editorType(),
isSqlDialect: self.getSnippetViewSettings(self.editorType()).sqlDialect
});
+ }
self.changeURL(
self.URLS.editor + '?editor=' + data.document.id + '&type=' + self.editorType()
);
@@ -591,10 +593,12 @@ class EditorViewModel {
};
self.newNotebook = function(editorType, callback, queryTab) {
+ if (!self.isNotificationManager()) {
huePubSub.publish('active.snippet.type.changed', {
type: editorType,
isSqlDialect: editorType ? self.getSnippetViewSettings(editorType).sqlDialect : undefined
});
+ }
$.post(
'/notebook/api/create_notebook',
{
@@ -619,6 +623,7 @@ class EditorViewModel {
if (window.location.getParameter('type') === '') {
hueUtils.changeURLParameter('type', self.editorType());
}
+ if (!self.isNotificationManager()) {
huePubSub.publish('active.snippet.type.changed', {
type: editorType,
isSqlDialect: editorType
@@ -626,6 +631,7 @@ class EditorViewModel {
: undefined
});
}
+ }
if (callback) {
callback();
