1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 10:16:26 +00:00

v0.2.4 - Minor fix

This commit is contained in:
Rokt33r
2015-08-24 06:14:13 +09:00
parent 3308eeaf82
commit f60856b998
2 changed files with 9 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
function deleteItemFromTargetArray (item, targetArray) {
if (targetArray == null) targetArray = []
targetArray.some(function (_item, index) {
if (_item.id === item.id) {
targetArray.splice(index, 1)
@@ -11,6 +12,8 @@ function deleteItemFromTargetArray (item, targetArray) {
}
function updateItemToTargetArray (item, targetArray) {
if (targetArray == null) targetArray = []
var isNew = !targetArray.some(function (_item, index) {
if (_item.id === item.id) {
targetArray.splice(index, 1, item)