userAccount.controller.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. (function(){
  2. 'use strict';
  3. app.controller('UserAccount', ['$scope', function($scope){
  4. $scope.check = "trip";
  5. $scope.userName = "setTimeout";
  6. $scope.userNameClick = true;
  7. $scope.tripName = "Название";
  8. $scope.tripNameClick = true;
  9. $scope.gallery = [
  10. {src: './image/users-photos/image-1.png', desc: 'Image 01'},
  11. {src: './image/users-photos/image-2.png', desc: 'Image 02'},
  12. {src: './image/users-photos/image-3.png', desc: 'Image 03'},
  13. {src: './image/users-photos/image-4.png', desc: 'Image 04'},
  14. {src: './image/users-photos/image-5.png', desc: 'Image 05'},
  15. {src: './image/users-photos/image-6.png', desc: 'Image 06'},
  16. {src: './image/users-photos/image-7.png', desc: 'Image 07'}
  17. ];
  18. $scope._Index = 0;
  19. $scope.isActive = function(index) {
  20. return $scope._Index === index;
  21. };
  22. $scope.showPrev = function() {
  23. $scope._Index = ($scope._Index > 0) ? --$scope._Index : $scope.gallery.length - 1;
  24. };
  25. $scope.showNext = function() {
  26. $scope._Index = ($scope._Index < $scope.gallery.length - 1) ? ++$scope._Index : 0;
  27. };
  28. $scope.showPhoto = function(index) {
  29. $scope._Index = index;
  30. };
  31. $scope.userNameClickHandler_1 = function() {
  32. $scope.userNameClick = false;
  33. };
  34. $scope.userNameClickHandler_2 = function(keyEvent) {
  35. if (keyEvent.which === 13) {
  36. $scope.userNameClick = true;
  37. }
  38. };
  39. $scope.tripNameClickHandler_1 = function() {
  40. $scope.tripNameClick = false;
  41. };
  42. $scope.tripNameClickHandler_2 = function(keyEvent) {
  43. if (keyEvent.which === 13) {
  44. $scope.tripNameClick = true;
  45. }
  46. };
  47. setTimeout(function() {
  48. var list1 = document.getElementById('plane-trip-list1');
  49. var sortableList1 = Sortable.create(list1, {
  50. group: 'plane-trip-group',
  51. animation: 300
  52. });
  53. var list2 = document.getElementById('plane-trip-list2');
  54. var sortableList2 = Sortable.create(list2, {
  55. group: 'plane-trip-group',
  56. animation: 300
  57. });
  58. }, 1000);
  59. $scope.planeTrip = function() {
  60. if ($scope.check == "" || $scope.check == "article") {
  61. $scope.check = "trip";
  62. return;
  63. }
  64. $scope.check = "";
  65. return;
  66. };
  67. $scope.writeArticle = function() {
  68. if ($scope.check == "" || $scope.check == "trip") {
  69. $scope.check = "article";
  70. return;
  71. }
  72. $scope.check = "";
  73. return;
  74. };
  75. $scope.map = {
  76. center: {
  77. latitude: 45,
  78. longitude: -73
  79. },
  80. zoom: 10
  81. };
  82. $scope.bd = {
  83. northeast: {
  84. latitude: 51.219053,
  85. longitude: 4.404418
  86. },
  87. southwest: {
  88. latitude: -51.219053,
  89. longitude: -4.404418
  90. }
  91. };
  92. }]);
  93. })()