From d58f5bd61bd3ec2c3cdd66c03977f0c788f5cb33 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 31 Jan 2019 14:22:20 +0530 Subject: [PATCH] update list items by id --- static/js/folders.js | 13 ++++++------- static/js/list.js | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/static/js/folders.js b/static/js/folders.js index 812f8bd..17775b9 100644 --- a/static/js/folders.js +++ b/static/js/folders.js @@ -314,7 +314,7 @@ oml.ui.folders = function() { }; - that.updateItems = function(items) { + that.updateItems = function(list, items) { var $list; if (arguments.length == 0) { oml.getLists(function(lists) { @@ -326,12 +326,11 @@ oml.ui.folders = function() { }); }); } else { - $list = $lists.filter(function($list) { - return $list.options('selected').length; - })[0]; - if ($list && !Ox.isEmpty($list.value(ui._list))) { - $list.value(ui._list, 'items', items); - } + $lists.forEach(function($list) { + if (!Ox.isEmpty($list.value(list))) { + $list.value(list, 'items', items); + } + }) } }; diff --git a/static/js/list.js b/static/js/list.js index 9af026d..3c159ae 100644 --- a/static/js/list.js +++ b/static/js/list.js @@ -64,7 +64,7 @@ oml.ui.list = function() { && ui.find.conditions[0].key == 'list' && ui.find.conditions[0].operator == '==' )) { - oml.$ui.folders.updateItems(data.items); + oml.$ui.folders.updateItems(ui.find.conditions[0].value, data.items); } oml.$ui.statusbar.set('total', data); },