16
16
var app = angular.module('app', ['ui.grid']);
17
17
18
18
app.controller('MainCtrl', ['$scope', function ($scope) {
19
-
19
+
20
20
}]);
21
21
</script>
22
22
30
30
*/
31
31
angular . module ( 'ui.grid' )
32
32
33
- . directive ( 'uiGridMenu' , [ '$compile' , '$timeout' , '$window' , '$document' , 'gridUtil' , 'uiGridConstants' ,
33
+ . directive ( 'uiGridMenu' , [ '$compile' , '$timeout' , '$window' , '$document' , 'gridUtil' , 'uiGridConstants' ,
34
34
function ( $compile , $timeout , $window , $document , gridUtil , uiGridConstants ) {
35
35
var uiGridMenu = {
36
36
priority : 0 ,
@@ -46,7 +46,7 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants) {
46
46
var self = this ;
47
47
var menuMid ;
48
48
var $animate ;
49
-
49
+
50
50
// *** Show/Hide functions ******
51
51
self . showMenu = $scope . showMenu = function ( event , args ) {
52
52
if ( ! $scope . shown ) {
@@ -57,11 +57,11 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants) {
57
57
* animate removal of the ng-if, as the menu items aren't there yet. And we don't want
58
58
* to rely on ng-show only, as that leaves elements in the DOM that are needlessly evaluated
59
59
* on scroll events.
60
- *
60
+ *
61
61
* Note when testing animation that animations don't run on the tutorials. When debugging it looks
62
62
* like they do, but angular has a default $animate provider that is just a stub, and that's what's
63
- * being called. ALso don't be fooled by the fact that your browser has actually loaded the
64
- * angular-translate.js, it's not using it. You need to test animations in an external application.
63
+ * being called. ALso don't be fooled by the fact that your browser has actually loaded the
64
+ * angular-translate.js, it's not using it. You need to test animations in an external application.
65
65
*/
66
66
$scope . shown = true ;
67
67
@@ -96,7 +96,7 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants) {
96
96
* In order to animate cleanly we animate the addition of ng-hide, then use a $timeout to
97
97
* set the ng-if (shown = false) after the animation runs. In theory we can cascade off the
98
98
* callback on the addClass method, but it is very unreliable with unit tests for no discernable reason.
99
- *
99
+ *
100
100
* The user may have clicked on the menu again whilst
101
101
* we're waiting, so we check that the mid isn't shown before applying the ng-if.
102
102
*/
@@ -120,7 +120,7 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants) {
120
120
$scope . showMenu ( event , args ) ;
121
121
} ) ;
122
122
123
-
123
+
124
124
// *** Auto hide when click elsewhere ******
125
125
var applyHideMenu = function ( ) {
126
126
if ( $scope . shown ) {
@@ -129,7 +129,7 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants) {
129
129
} ) ;
130
130
}
131
131
} ;
132
-
132
+
133
133
if ( typeof ( $scope . autoHide ) === 'undefined' || $scope . autoHide === undefined ) {
134
134
$scope . autoHide = true ;
135
135
}
@@ -141,7 +141,7 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants) {
141
141
$scope . $on ( '$destroy' , function ( ) {
142
142
angular . element ( document ) . off ( 'click touchstart' , applyHideMenu ) ;
143
143
} ) ;
144
-
144
+
145
145
146
146
$scope . $on ( '$destroy' , function ( ) {
147
147
angular . element ( $window ) . off ( 'resize' , applyHideMenu ) ;
@@ -153,8 +153,8 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants) {
153
153
154
154
$scope . $on ( '$destroy' , $scope . $on ( uiGridConstants . events . ITEM_DRAGGING , applyHideMenu ) ) ;
155
155
} ,
156
-
157
-
156
+
157
+
158
158
controller : [ '$scope' , '$element' , '$attrs' , function ( $scope , $element , $attrs ) {
159
159
var self = this ;
160
160
} ]
@@ -184,12 +184,12 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants) {
184
184
pre : function ( $scope , $elm , $attrs , controllers ) {
185
185
var uiGridCtrl = controllers [ 0 ] ,
186
186
uiGridMenuCtrl = controllers [ 1 ] ;
187
-
187
+
188
188
if ( $scope . templateUrl ) {
189
189
gridUtil . getTemplate ( $scope . templateUrl )
190
190
. then ( function ( contents ) {
191
191
var template = angular . element ( contents ) ;
192
-
192
+
193
193
var newElm = $compile ( template ) ( $scope ) ;
194
194
$elm . replaceWith ( newElm ) ;
195
195
} ) ;
@@ -253,4 +253,4 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants) {
253
253
return uiGridMenuItem ;
254
254
} ] ) ;
255
255
256
- } ) ( ) ;
256
+ } ) ( ) ;
0 commit comments