iss #19 - Rewrite query editor switching for more scalability.

This commit is contained in:
Alexander Zobnin
2015-07-27 17:49:30 +03:00
parent fd67ed6194
commit 72478c0bc6
2 changed files with 16 additions and 10 deletions

View File

@@ -13,7 +13,7 @@ define([
$scope.init = function () {
$scope.targetLetters = targetLetters;
if ($scope.target.ITService) {
if ($scope.target.mode === 1) {
$scope.slaPropertyList = [
{name: "Status", property: "status"},
{name: "SLA", property: "sla"},
@@ -43,8 +43,14 @@ define([
$scope.target.errors = validateTarget($scope.target);
};
$scope.switchEditorMode = function () {
$scope.target.ITService = !$scope.target.ITService;
/**
* Switch query editor to specified mode.
* Modes:
* 0 - items
* 1 - IT services
*/
$scope.switchEditorMode = function (mode) {
$scope.target.mode = mode;
$scope.init();
};