From 8e6c45871fe465cde938aaef37799a37b4505e75 Mon Sep 17 00:00:00 2001 From: kunw Date: Mon, 18 Apr 2016 23:13:36 +0800 Subject: [PATCH] refined structure of item-detail.js --- static/resources/js/item-detail.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/static/resources/js/item-detail.js b/static/resources/js/item-detail.js index 991e6abaa..de66c8684 100644 --- a/static/resources/js/item-detail.js +++ b/static/resources/js/item-detail.js @@ -124,15 +124,16 @@ jQuery(function(){ url: "/api/repositories/manifests?repo_name=" + repoName + "&tag=" + imageId, type: "get", success: function(data, status, xhr){ - if(data){ - for(var i in data){ - if(data[i] == ""){ - data[i] = "N/A"; - } - } - data.Created = moment(new Date(data.Created)).format("YYYY-MM-DD HH:mm:ss"); - $("#dlgModal").dialogModal({"title": i18n.getMessage("image_details"), "content": data}); - } + if(data){ + for(var i in data){ + if(data[i] == ""){ + data[i] = "N/A"; + } + } + data.Created = moment(new Date(data.Created)).format("YYYY-MM-DD HH:mm:ss"); + + $("#dlgModal").dialogModal({"title": i18n.getMessage("image_details"), "content": data}); + } } }).exec(); }); @@ -330,6 +331,7 @@ jQuery(function(){ getUserRoleCallback(userId); }); $("#tblUser .glyphicon-trash").on("click", function(){ + var roleId = $(this).attr("roleid"); var userId = $(this).attr("userid"); new AjaxUtil({ url: "/api/projects/" + $("#projectId").val() + "/members/" + userId,