@@ -50,35 +50,6 @@ formsAngular
50
50
var subkeys = [ ] ;
51
51
var tabsSetup = false ;
52
52
53
- var generateNgShow = function ( showWhen , model ) {
54
-
55
- function evaluateSide ( side ) {
56
- var result = side ;
57
- if ( typeof side === 'string' ) {
58
- if ( side . slice ( 0 , 1 ) === '$' ) {
59
- result = ( model || 'record' ) + '.' ;
60
- var parts = side . slice ( 1 ) . split ( '.' ) ;
61
- if ( parts . length > 1 ) {
62
- var lastBit = parts . pop ( ) ;
63
- result += parts . join ( '.' ) + '[$index].' + lastBit ;
64
- } else {
65
- result += side . slice ( 1 ) ;
66
- }
67
- } else {
68
- result = '\'' + side + '\'' ;
69
- }
70
- }
71
- return result ;
72
- }
73
-
74
- var conditionText = [ 'eq' , 'ne' , 'gt' , 'gte' , 'lt' , 'lte' ] ,
75
- conditionSymbols = [ '===' , '!==' , '>' , '>=' , '<' , '<=' ] ,
76
- conditionPos = conditionText . indexOf ( showWhen . comp ) ;
77
-
78
- if ( conditionPos === - 1 ) { throw new Error ( 'Invalid comparison in showWhen' ) ; }
79
- return evaluateSide ( showWhen . lhs ) + conditionSymbols [ conditionPos ] + evaluateSide ( showWhen . rhs ) ;
80
- } ;
81
-
82
53
var generateInput = function ( fieldInfo , modelString , isRequired , idString , options ) {
83
54
var nameString ;
84
55
if ( ! modelString ) {
@@ -300,30 +271,7 @@ formsAngular
300
271
} ;
301
272
302
273
var handleField = function ( info , options ) {
303
- var includeIndex = false ;
304
- var insert = '' ;
305
- if ( options . index ) {
306
- try {
307
- parseInt ( options . index ) ;
308
- includeIndex = true ;
309
- } catch ( err ) {
310
- // Nothing to do
311
- }
312
- }
313
- if ( info . showWhen ) {
314
- if ( typeof info . showWhen === 'string' ) {
315
- insert += 'ng-show="' + info . showWhen + '"' ;
316
- } else {
317
- insert += 'ng-show="' + generateNgShow ( info . showWhen , options . model ) + '"' ;
318
- }
319
- }
320
- if ( includeIndex ) {
321
- insert += ' id="cg_' + info . id . replace ( '_' , '-' + attrs . index + '-' ) + '"' ;
322
- } else {
323
- insert += ' id="cg_' + info . id . replace ( / \. / g, '-' ) + '"' ;
324
- }
325
-
326
- var fieldChrome = formMarkupHelper . fieldChrome ( scope , info , options , insert ) ;
274
+ var fieldChrome = formMarkupHelper . fieldChrome ( scope , info , options ) ;
327
275
var template = fieldChrome . template ;
328
276
329
277
if ( info . schema ) {
@@ -435,6 +383,10 @@ formsAngular
435
383
// var processInstructions = function (instructionsArray, topLevel, groupId) {
436
384
// removing groupId as it was only used when called by containerType container, which is removed for now
437
385
var processInstructions = function ( instructionsArray , topLevel , options ) {
386
+ if ( options . index ) {
387
+ alert ( 'Found where options index is used' ) ; // This is tested for shen generating field chrome, but cannot see how it is ever generated. Redundant? AM removing 9/2/15
388
+ throw new Error ( 'Found where options index is used' ) ;
389
+ }
438
390
var result = '' ;
439
391
if ( instructionsArray ) {
440
392
for ( var anInstruction = 0 ; anInstruction < instructionsArray . length ; anInstruction ++ ) {
0 commit comments