From: Karol Pawlowski Date: Thu, 15 Jan 2015 10:33:20 +0000 (+0100) Subject: [Bookmark] Fix recursion and returned type of url X-Git-Tag: submit/tizen_tv/20150603.064601~1^2~624 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7c54e8b63061509a2fd321eab1ee7d9a1bbc4165;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Bookmark] Fix recursion and returned type of url [Verification] TCT result: 36/36 Change-Id: If90fee74af77b00291d02a4165716521b25faa27 Signed-off-by: Karol Pawlowski --- diff --git a/src/bookmark/bookmark_api.js b/src/bookmark/bookmark_api.js index 7947a620..f797897a 100644 --- a/src/bookmark/bookmark_api.js +++ b/src/bookmark/bookmark_api.js @@ -135,13 +135,13 @@ BookmarkProvider.prototype.addToFolder = function() { nullable: false} ]); var ret = native_.callSync('Bookmark_add', - { - title: args.bookmark.title, - url: args.bookmark.url || '/', - parentId: args.parentId, - type: args.bookmark instanceof tizen.BookmarkFolder ? 1 : 0 - } - ); + { + title: args.bookmark.title, + url: args.bookmark.url, + parentId: args.parentId, + type: args.bookmark instanceof tizen.BookmarkFolder ? 1 : 0 + } + ); if (native_.isFailure(ret)) { return false; } @@ -234,9 +234,10 @@ BookmarkProvider.prototype.getFolderItems = function() { obj.parent = this.getFolder(item.parentId); _edit.disallow(); result.push(obj); - if (args.recursive) { - result = result.concat(this.getFolderItems(item.id, true)); - } + } + + if (args.recursive) { + result = result.concat(this.getFolderItems(item.id, true)); } } return result; @@ -291,6 +292,8 @@ tizen.BookmarkItem = function() { }, url: { get: function() { + if (args.url === "undefined") + args.url = undefined; return args.url; }, enumerable: true,