Merge "Nodes query rewritten to generic rest client"
[vid.git] / vid-app-common / src / main / webapp / app / vid / scripts / controller / previousVersionDialogController.js
1 "use strict";
2
3 var previousVersionDialogController = function( COMPONENT, FIELD, $scope, $http, $timeout, $log,
4                 CreationService, UtilityService, DataService,VIDCONFIGURATION) {
5         $scope.isTableDialogVisible = false;
6         $scope.summaryControl = {};
7         $scope.userProvidedControl = {};
8
9         var callbackFunction = undefined;
10         var componentId = undefined;
11
12         $scope.$on("createTableComponent", function(event, request) {
13
14                 $scope.isTableSpinnerVisible = true; 
15                 $scope.isTableErrorVisible = false;
16                 $scope.isTableDialogVisible = true;
17                 $scope.popup.isTablePopUpVisible = true;
18                 componentId = request.componentId;
19                 CreationService.initializeComponent(request.componentId);
20                 callbackFunction = request.callbackFunction;
21                 CreationService.setHttpErrorHandler(function(response) {
22                         showError("System failure", UtilityService
23                                         .getHttpErrorMessage(response));
24                 });
25                 $scope.isTableSpinnerVisible = false;
26         });
27         
28         
29         $scope.cancelTable = function(){
30                 $scope.isTableDialogVisible = false;
31                 $scope.popup.isTablePopUpVisible = false;
32         }
33         
34         
35 }
36
37 app
38                 .controller("previousVersionDialogController", [ "COMPONENT", "FIELD", "$scope", "$http",
39                                 "$timeout", "$log", "CreationService", "UtilityService", "DataService","VIDCONFIGURATION",
40                                 previousVersionDialogController ]);