rowCtrl.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // define([
  2. // 'angular',
  3. // 'lodash',
  4. // 'app/core/config'
  5. // ],
  6. // function (angular, _, config) {
  7. // 'use strict';
  8. //
  9. // var module = angular.module('grafana.controllers');
  10. //
  11. // module.controller('RowCtrl', function($scope, $rootScope, $timeout) {
  12. //
  13. // $scope.moveRow = function(direction) {
  14. // var rowsList = $scope.dashboard.rows;
  15. // var rowIndex = _.indexOf(rowsList, $scope.row);
  16. // var newIndex = rowIndex;
  17. // switch(direction) {
  18. // case 'up': {
  19. // newIndex = rowIndex - 1;
  20. // break;
  21. // }
  22. // case 'down': {
  23. // newIndex = rowIndex + 1;
  24. // break;
  25. // }
  26. // case 'top': {
  27. // newIndex = 0;
  28. // break;
  29. // }
  30. // case 'bottom': {
  31. // newIndex = rowsList.length - 1;
  32. // break;
  33. // }
  34. // default: {
  35. // newIndex = rowIndex;
  36. // }
  37. // }
  38. // if (newIndex >= 0 && newIndex <= (rowsList.length - 1)) {
  39. // _.move(rowsList, rowIndex, newIndex);
  40. // }
  41. // };
  42. //
  43. // $scope.setHeight = function(height) {
  44. // $scope.row.height = height;
  45. // $scope.$broadcast('render');
  46. // };
  47. //
  48. // $scope.init();
  49. // });
  50. //
  51. // });