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

Commit

Permalink
Do not allow demo to be saved after edited
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Bottazzini <[email protected]>
  • Loading branch information
Bruno Bottazzini committed Nov 10, 2015
1 parent dccded4 commit a51092b
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions client/js/controllers/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@
dataTree = data;
var repos = _l.id.split("repos")[1];
var rfinal = repos.split("/");
$scope.owner = rfinal[1];
$scope.repo = rfinal[2];
$scope.subFolder = rfinal[1];
$scope.folder = rfinal[2];
$scope.getConfigurationlist(_l.id);
isLeaf = _l.isLeaf;
aceConfig.set("modePath", "libs/ace-builds/src-min/");
Expand All @@ -116,12 +116,8 @@
$scope.fbpType = false;
}

if ($scope.owner === "solettaproject") {
editor.setHighlightActiveLine(true);
} else {
editor.setHighlightActiveLine(false);
editor.setReadOnly(false);
}
editor.setHighlightActiveLine(false);
editor.setReadOnly(false);
});
$scope.root = false;
} else {
Expand Down Expand Up @@ -179,7 +175,7 @@
};

$scope.getConfigurationlist = function (repo_id) {
if ($scope.owner && $scope.repo) {
if ($scope.folder && $scope.subFolder) {
var id = "/";
var start_count = false;
var count = 0;
Expand Down Expand Up @@ -532,7 +528,8 @@
};

editor.keyBinding.onCommandKey = function(e, hashId, keyCode) {
if ($scope.shouldSave === false && $scope.fileName) {
if ($scope.shouldSave === false && $scope.fileName &&
$scope.folder !== "demo") {
$scope.fileName = $scope.fileName + "*";
$scope.shouldSave = true;
}
Expand Down

0 comments on commit a51092b

Please sign in to comment.