1 appDS2.controller("collaborateListControllerDS2", function ($scope,$http, $modal,AdminService) {
3 $scope.showInput = true;
4 $scope.totalPages1 = 5;
5 $scope.viewPerPage1 = 8;
6 $scope.currentPage1 = 1;
7 $scope.showLoader = false;
8 $scope.firstPlay = true;
9 // Start with empty list to silence error in console
10 $scope.tableData = [];
11 $scope.tableCollbItems = [];
12 // $scope.totalPages1 = 20;
13 $scope.$watch('viewPerPage1', function(val) {
14 $scope.showLoader = true;
15 AdminService.getCollaborateList($scope.currentPage1, val).then(function(data){
17 $scope.data = JSON.parse(j.data);
18 $scope.tableData = $scope.data;
19 var totalItems = $scope.tableData.length;
20 //console.log(totalItems);
21 $scope.totalPages1 = Math.ceil(totalItems / $scope.viewPerPage1);
22 $scope.showLoader = false;
23 $scope.currentPage1=1;
24 var endIndex = 1 * $scope.viewPerPage1;
25 var startIndex = endIndex - $scope.viewPerPage1;
26 $scope.tableCollbItems = $scope.tableData.slice(startIndex, endIndex);
28 console.log("failed");
33 $scope.customHandler1 = function(num) {
34 $scope.currentPage1=num;
35 var endIndex = num * $scope.viewPerPage1;
36 var startIndex = endIndex - $scope.viewPerPage1;
37 $scope.tableCollbItems = $scope.tableData.slice(startIndex, endIndex);
40 $scope.openCollaboration = function(chatId){
41 openInNewTab('openCollaboration?chat_id=' + chatId);
44 $scope.toggleProfileActive = function(profileId) {
45 modalService.popupConfirmWin("Confirm","You are about to change user's active status. Do you want to continue?",
47 $http.get("profile/toggleProfileActive?profile_id="+profileId).success(function(){});
53 function openInNewTab(url) {
54 var win = window.open(url, '_blank');
58 function downloadScreenCaptureExtenstion() {
60 var chromeURL = 'https://chrome.google.com/webstore/detail/icgmlogfeajbfdffajhoebcfbibfhaen';
61 var firefoxURL = 'https://addons.mozilla.org/en-US/firefox/addon/screen-capturing-capability';
69 var win = window.open(url);