mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2025-12-31 00:40:01 +01:00
20 lines
564 B
JavaScript
20 lines
564 B
JavaScript
var ATEditor = (function(ATEditor, model) {
|
|
|
|
function QuestController($scope, $routeParams) {
|
|
$scope.datasource = model.quests;
|
|
$scope.obj = $scope.datasource.findById($routeParams.id);
|
|
$scope.addQuestStage = function() {
|
|
$scope.obj.stages.push({});
|
|
};
|
|
$scope.removeQuestStage = function(stage) {
|
|
var idx = $scope.obj.stages.indexOf(stage);
|
|
$scope.obj.stages.splice(idx, 1);
|
|
};
|
|
};
|
|
|
|
ATEditor.controllers = ATEditor.controllers || {};
|
|
ATEditor.controllers.QuestController = QuestController;
|
|
|
|
return ATEditor;
|
|
})(ATEditor, ATEditor.model);
|