-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new version without angular routing service and deep linking - works …
…much better now - occasional ui bugs do occur
- Loading branch information
Showing
23 changed files
with
214 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,39 @@ | ||
// <autogenerated> | ||
// This file was generated by T4 code generator AngularGenerator.tt. | ||
// Any changes made to this file manually will be lost next time the file is regenerated. | ||
// </autogenerated> | ||
|
||
'use strict'; | ||
|
||
var crudControllers = angular.module('crudControllers', []); | ||
|
||
crudControllers.controller('fullViewController', function($scope, $route, $location) { | ||
$scope.$on('$routeChangeSuccess', function() { | ||
var path = $location.path(); | ||
console.log(path); | ||
$scope.showEmployer = false; | ||
$scope.showEmployee = false; | ||
if (path === '/employer') { | ||
$scope.showEmployer = true; | ||
} else if (path.lastIndexOf('/Employees', 0) === 0) { | ||
$scope.showEmployer = true; | ||
$scope.showEmployee = true; | ||
} else if (path.lastIndexOf('/Taxcards', 0) === 0) { | ||
$scope.showEmployer = true; | ||
$scope.showEmployee = true; | ||
$scope.showTaxcard = true; | ||
} else { | ||
$scope.showEmployer = true; | ||
} | ||
}); | ||
}); | ||
|
||
crudControllers.controller('employeeController', function($scope, $http, $routeParams) { | ||
|
||
$http.get('../api/Employee/' + $routeParams.id).success(function (data) { | ||
$scope.employee = data; | ||
}); | ||
} | ||
); | ||
|
||
// ReSharper disable once InconsistentNaming | ||
crudControllers.controller('employerController', function($scope, $http) { | ||
|
||
//if ($state.current.data.employer !== undefined) { | ||
// $scope.employer = $state.current.data.employer; | ||
// return; | ||
//} | ||
|
||
$http.get('../api/Employer').success(function(data) { | ||
$scope.employer = data; | ||
|
||
// DataStore.employer = data; | ||
}); | ||
} | ||
); | ||
|
||
|
||
crudControllers.controller('salarycalculationController', function($scope, $http) { | ||
$http.get('../api/SalaryCalculation').success(function(data) { | ||
$scope.salarycalculation = data; | ||
}); | ||
} | ||
); | ||
|
||
|
||
crudControllers.controller('taxcardController', function ($scope, $http, $routeParams) { | ||
$http.get('../api/Taxcard/' + $routeParams.id).success(function (data) { | ||
$scope.taxcard = data; | ||
}); | ||
} | ||
); | ||
crudControllers.controller('fullViewController', ['$scope', '$http', | ||
function ($scope, $http) { | ||
var getEmployer = function () { | ||
$http.get('../api/Employer').success(function (data) { | ||
$scope.employer = data; | ||
$scope.employee = undefined; | ||
}); | ||
}; | ||
|
||
$scope.getEmployer = getEmployer; | ||
|
||
getEmployer(); | ||
|
||
$scope.getEmployee = function (id) { | ||
$http.get('../api/Employee/' + id).success(function (data) { | ||
$scope.employee = data; | ||
$scope.isactive = false; | ||
$scope.taxcard = undefined; | ||
}); | ||
}; | ||
|
||
$scope.getTaxcard = function (id) { | ||
$http.get('../api/Taxcard/' + id).success(function (data) { | ||
$scope.taxcard = data; | ||
$scope.isactive = true; | ||
}); | ||
}; | ||
}]); | ||
|
||
//crudControllers.controller('salarycalculationController', function ($scope, $http) { | ||
// $http.get('../api/SalaryCalculation').success(function (data) { | ||
// $scope.salarycalculation = data; | ||
// }); | ||
//} | ||
//); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
(function () { | ||
var getBootstrapColumnSize = function(countOfActiveItems) { | ||
var calculated = ((12 / countOfActiveItems) - 1); | ||
|
||
return calculated < 4 ? 4 : calculated; | ||
}; | ||
|
||
var resetColumnSizes = function () { | ||
var $activeOnes = $('div[ng-app]').children('div.active'); | ||
var count = $activeOnes.length; | ||
var classnameToApply = 'col-md-' + getBootstrapColumnSize(count); | ||
|
||
$activeOnes.last().addClass('lastActive'); | ||
|
||
$activeOnes.each(function () { | ||
$(this).toggleClass(classnameToApply); | ||
$(this).removeClass('col-md-1'); | ||
|
||
if (!($(this).is($activeOnes.last()))) { | ||
$(this).removeClass('lastActive'); | ||
} | ||
|
||
for (var i = 1; i <= 3; i++) { | ||
if (i !== count) { | ||
$(this).removeClass('col-md-' + getBootstrapColumnSize(i)); | ||
} | ||
} | ||
}); | ||
}; | ||
|
||
$('div.active', 'div[ng-app]').livequery( | ||
function () { | ||
resetColumnSizes(); | ||
}, | ||
function () { | ||
if (!($(this).hasClass('active'))) { | ||
for (var i = 1; i <= 3; i++) { | ||
$(this).removeClass('col-md-' + getBootstrapColumnSize(i)); | ||
$(this).removeClass('lastActive'); | ||
$(this).addClass('col-md-1'); | ||
} | ||
} | ||
|
||
resetColumnSizes(); | ||
}); | ||
|
||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.