From 8b92756595e829b8887a4c6f4f589b9c378b7387 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 30 Apr 2019 12:41:13 +0200 Subject: [PATCH] show import error instaed of 100 existing items --- static/js/addItemDialog.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/static/js/addItemDialog.js b/static/js/addItemDialog.js index d2b2ec36..4bdef958 100644 --- a/static/js/addItemDialog.js +++ b/static/js/addItemDialog.js @@ -107,7 +107,32 @@ pandora.ui.addItemDialog = function(options) { pandora.api.getMediaUrlInfo({ url: input }, function(result) { - onInfo(result.data.items.map(getVideoInfo)); + if (requslt.data.items.length) { + onInfo(result.data.items.map(getVideoInfo)); + } else { + $screen.stop(); + that.close(); + var error = Ox.Dialog({ + buttons: [ + {}, + Ox.Button({ + id: 'close', + title: Ox._('Close') + }).bindEvent({ + click: function() { + error.close(); + } + }) + ], + closeButton: true, + content: Ox.Element().css({padding: '32px'}).html('Import failed'), + height: 96, + keys: {escape: 'close'}, + removeOnClose: true, + title: Ox._('Import Error'), + width: 192 + }).open() + } }); } }