@@ -103,122 +103,3 @@ angular.module('ui.bootstrap.progressbar', [])
103
103
}
104
104
} ;
105
105
} ) ;
106
-
107
- /* Deprecated progressbar below */
108
-
109
- angular . module ( 'ui.bootstrap.progressbar' )
110
-
111
- . value ( '$progressSuppressWarning' , false )
112
-
113
- . controller ( 'ProgressController' , [ '$scope' , '$attrs' , 'uibProgressConfig' , '$log' , '$progressSuppressWarning' , function ( $scope , $attrs , progressConfig , $log , $progressSuppressWarning ) {
114
- if ( ! $progressSuppressWarning ) {
115
- $log . warn ( 'ProgressController is now deprecated. Use UibProgressController instead.' ) ;
116
- }
117
-
118
- var self = this ,
119
- animate = angular . isDefined ( $attrs . animate ) ? $scope . $parent . $eval ( $attrs . animate ) : progressConfig . animate ;
120
-
121
- this . bars = [ ] ;
122
- $scope . max = angular . isDefined ( $scope . max ) ? $scope . max : progressConfig . max ;
123
-
124
- this . addBar = function ( bar , element , attrs ) {
125
- if ( ! animate ) {
126
- element . css ( { 'transition' : 'none' } ) ;
127
- }
128
-
129
- this . bars . push ( bar ) ;
130
-
131
- bar . max = $scope . max ;
132
- bar . title = attrs && angular . isDefined ( attrs . title ) ? attrs . title : 'progressbar' ;
133
-
134
- bar . $watch ( 'value' , function ( value ) {
135
- bar . recalculatePercentage ( ) ;
136
- } ) ;
137
-
138
- bar . recalculatePercentage = function ( ) {
139
- bar . percent = + ( 100 * bar . value / bar . max ) . toFixed ( 2 ) ;
140
-
141
- var totalPercentage = self . bars . reduce ( function ( total , bar ) {
142
- return total + bar . percent ;
143
- } , 0 ) ;
144
-
145
- if ( totalPercentage > 100 ) {
146
- bar . percent -= totalPercentage - 100 ;
147
- }
148
- } ;
149
-
150
- bar . $on ( '$destroy' , function ( ) {
151
- element = null ;
152
- self . removeBar ( bar ) ;
153
- } ) ;
154
- } ;
155
-
156
- this . removeBar = function ( bar ) {
157
- this . bars . splice ( this . bars . indexOf ( bar ) , 1 ) ;
158
- } ;
159
-
160
- $scope . $watch ( 'max' , function ( max ) {
161
- self . bars . forEach ( function ( bar ) {
162
- bar . max = $scope . max ;
163
- bar . recalculatePercentage ( ) ;
164
- } ) ;
165
- } ) ;
166
- } ] )
167
-
168
- . directive ( 'progress' , [ '$log' , '$progressSuppressWarning' , function ( $log , $progressSuppressWarning ) {
169
- return {
170
- replace : true ,
171
- transclude : true ,
172
- controller : 'ProgressController' ,
173
- require : 'progress' ,
174
- scope : {
175
- max : '=?' ,
176
- title : '@?'
177
- } ,
178
- templateUrl : 'template/progressbar/progress.html' ,
179
- link : function ( ) {
180
- if ( ! $progressSuppressWarning ) {
181
- $log . warn ( 'progress is now deprecated. Use uib-progress instead.' ) ;
182
- }
183
- }
184
- } ;
185
- } ] )
186
-
187
- . directive ( 'bar' , [ '$log' , '$progressSuppressWarning' , function ( $log , $progressSuppressWarning ) {
188
- return {
189
- replace : true ,
190
- transclude : true ,
191
- require : '^progress' ,
192
- scope : {
193
- value : '=' ,
194
- type : '@'
195
- } ,
196
- templateUrl : 'template/progressbar/bar.html' ,
197
- link : function ( scope , element , attrs , progressCtrl ) {
198
- if ( ! $progressSuppressWarning ) {
199
- $log . warn ( 'bar is now deprecated. Use uib-bar instead.' ) ;
200
- }
201
- progressCtrl . addBar ( scope , element ) ;
202
- }
203
- } ;
204
- } ] )
205
-
206
- . directive ( 'progressbar' , [ '$log' , '$progressSuppressWarning' , function ( $log , $progressSuppressWarning ) {
207
- return {
208
- replace : true ,
209
- transclude : true ,
210
- controller : 'ProgressController' ,
211
- scope : {
212
- value : '=' ,
213
- max : '=?' ,
214
- type : '@'
215
- } ,
216
- templateUrl : 'template/progressbar/progressbar.html' ,
217
- link : function ( scope , element , attrs , progressCtrl ) {
218
- if ( ! $progressSuppressWarning ) {
219
- $log . warn ( 'progressbar is now deprecated. Use uib-progressbar instead.' ) ;
220
- }
221
- progressCtrl . addBar ( scope , angular . element ( element . children ( ) [ 0 ] ) , { title : attrs . title } ) ;
222
- }
223
- } ;
224
- } ] ) ;
0 commit comments