|
622 | 622 | priority: -150,
|
623 | 623 | require: '^uiGrid',
|
624 | 624 | scope: false,
|
| 625 | + controller: function () {}, |
625 | 626 | compile: function () {
|
626 | 627 | return {
|
627 | 628 | pre: function ($scope, $elm, $attrs, uiGridCtrl) {
|
|
696 | 697 | return {
|
697 | 698 | replace: true,
|
698 | 699 | priority: -99999, //this needs to run very last
|
699 |
| - require: ['^uiGrid', 'uiGridRenderContainer'], |
| 700 | + require: ['^uiGrid', 'uiGridRenderContainer', '?^uiGridCellnav'], |
700 | 701 | scope: false,
|
701 | 702 | compile: function () {
|
702 | 703 | return {
|
703 |
| - pre: function ($scope, $elm, $attrs, uiGridCtrl) { |
704 |
| - }, |
705 | 704 | post: function ($scope, $elm, $attrs, controllers) {
|
706 | 705 | var uiGridCtrl = controllers[0],
|
707 |
| - renderContainerCtrl = controllers[1]; |
| 706 | + renderContainerCtrl = controllers[1], |
| 707 | + cellNavController = controllers[2]; |
| 708 | + |
| 709 | + // Skip attaching cell-nav specific logic if the directive is not attached above us |
| 710 | + if (!cellNavController) { return; } |
708 | 711 |
|
709 | 712 | var containerId = renderContainerCtrl.containerId;
|
710 | 713 |
|
|
765 | 768 | return {
|
766 | 769 | priority: -150, // run after default uiGridCell directive and ui.grid.edit uiGridCell
|
767 | 770 | restrict: 'A',
|
768 |
| - require: '^uiGrid', |
| 771 | + require: ['^uiGrid', '?^uiGridCellnav'], |
769 | 772 | scope: false,
|
770 |
| - link: function ($scope, $elm, $attrs, uiGridCtrl) { |
| 773 | + link: function ($scope, $elm, $attrs, controllers) { |
| 774 | + var uiGridCtrl = controllers[0], |
| 775 | + cellNavController = controllers[1]; |
| 776 | + |
| 777 | + // Skip attaching cell-nav specific logic if the directive is not attached above us |
| 778 | + if (!cellNavController) { return; } |
| 779 | + |
771 | 780 | if (!$scope.col.colDef.allowCellFocus) {
|
772 | 781 | return;
|
773 | 782 | }
|
|
0 commit comments