Disallow JS functions in loops
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
parent
b5d1b1e74a
commit
e1ba7b792e
@ -17,7 +17,7 @@
|
||||
"new-cap": "warn",
|
||||
"no-array-constructor": "error",
|
||||
"no-eval": "error",
|
||||
"no-loop-func": "warn",
|
||||
"no-loop-func": "error",
|
||||
"no-mixed-spaces-and-tabs": "error",
|
||||
"no-multiple-empty-lines": "error",
|
||||
"no-new-func": "error",
|
||||
|
||||
@ -13,15 +13,16 @@ function Save_to_new_page (db, page_name, table_positions, callback) {
|
||||
Create_new_page(db, page_name, function (page) {
|
||||
if (page) {
|
||||
var tbl_cords = [];
|
||||
var saveCallback = function (id) {
|
||||
tbl_cords.push(id);
|
||||
if (table_positions.length === tbl_cords.length) {
|
||||
page.tbl_cords = tbl_cords;
|
||||
DesignerOfflineDB.addObject('pdf_pages', page);
|
||||
}
|
||||
};
|
||||
for (var pos = 0; pos < table_positions.length; pos++) {
|
||||
table_positions[pos].pdf_pg_nr = page.pg_nr;
|
||||
Save_table_positions(table_positions[pos], function (id) {
|
||||
tbl_cords.push(id);
|
||||
if (table_positions.length === tbl_cords.length) {
|
||||
page.tbl_cords = tbl_cords;
|
||||
DesignerOfflineDB.addObject('pdf_pages', page);
|
||||
}
|
||||
});
|
||||
Save_table_positions(table_positions[pos], saveCallback);
|
||||
}
|
||||
if (typeof callback !== 'undefined') {
|
||||
callback(page);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user