From a51092b48e66f82d6e04660af890fd26f2d97348 Mon Sep 17 00:00:00 2001 From: Bruno Bottazzini Date: Mon, 9 Nov 2015 18:56:23 -0200 Subject: [PATCH] Do not allow demo to be saved after edited Signed-off-by: Bruno Bottazzini --- client/js/controllers/editor.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/client/js/controllers/editor.js b/client/js/controllers/editor.js index 389d55c..1edc496 100644 --- a/client/js/controllers/editor.js +++ b/client/js/controllers/editor.js @@ -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/"); @@ -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 { @@ -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; @@ -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; }