check for empty originalText

This commit is contained in:
Prabhjyot Singh 2017-08-02 15:39:49 -07:00
parent d2a835f778
commit 8b8c2f9741
2 changed files with 6 additions and 3 deletions

View file

@ -1073,8 +1073,11 @@ function NotebookCtrl ($scope, $route, $routeParams, $location, $rootScope,
let thisScope = angular.element(
'#' + par.id + '_paragraphColumn_main').scope()
if (thisScope.dirtyText !== undefined ||
thisScope.dirtyText !== thisScope.originalText) {
if (thisScope.dirtyText === undefined ||
thisScope.originalText === undefined ||
thisScope.dirtyText === thisScope.originalText) {
return true
} else {
event.preventDefault()
BootstrapDialog.show({

View file

@ -645,7 +645,7 @@ function ResultCtrl ($scope, $rootScope, $route, $window, $routeParams, $locatio
}, newParagraphConfig.results[resultIndex], paragraph, resultIndex)
renderResult($scope.type, true)
} else {
websocketMsgSrv.commitParagraph(paragraph.id, title, text, newParagraphConfig, params)
return websocketMsgSrv.commitParagraph(paragraph.id, title, text, newParagraphConfig, params)
}
}