Commits

Matthew Schinckel committed 0731cf1

Only add rules if they haven't been added.

Comments (0)

Files changed (1)

jsonfield/static/js/json-table.js

                 $.each(rowData[conditionName]['rules'], function(i, rule){
                     var newRule = $.extend({}, defaults.rule, rule);
                     var jsonRule = JSON.stringify(rule);
-                    if ($.inArray(jsonRule, jsonRules)){
+                    if ($.inArray(jsonRule, jsonRules) == -1){
                         rules.push(newRule);
-                        jsonRules.push(jsonRule);                        
+                        jsonRules.push(jsonRule);
                     }
                 });
             }