Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
Replace onTextInput to OnCommandKey
Browse files Browse the repository at this point in the history
To identify if the document was changed not a simply input
detection is enough since it is needed to detect any delete
characters. The previous version was not detecting it.

Signed-off-by: Bruno Bottazzini <bruno.bottazzini@intel.com>
  • Loading branch information
Bruno Bottazzini committed Nov 9, 2015
1 parent a274923 commit 4a2d17f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions client/js/controllers/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
editor.session.setOption("useWorker", false);
editor.setFontSize(15);
editor.setTheme('ace/theme/monokai');
editor.keyBinding.origOnTextInput = editor.keyBinding.onTextInput;
editor.keyBinding.origOnCommandKey = editor.keyBinding.onCommandKey;

$scope.fbpType = true;
aceConfig.set("modePath", "js/ace/");
Expand Down Expand Up @@ -531,13 +531,12 @@
}
};


editor.keyBinding.onTextInput = function(text) {
editor.keyBinding.onCommandKey = function(e, hashId, keyCode) {
if ($scope.shouldSave === false && $scope.fileName) {
$scope.fileName = $scope.fileName + "*";
$scope.shouldSave = true;
}
this.origOnTextInput(text);
this.origOnCommandKey(e, hashId, keyCode);
};

$scope.editorChanged = function (e) {
Expand Down

0 comments on commit 4a2d17f

Please sign in to comment.