aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKumar Priyansh <[email protected]>2019-06-03 05:42:28 +0530
committerKumar Priyansh <[email protected]>2019-06-03 05:42:28 +0530
commit6b0736a3e456d1eb1ba3c565a67ad0e09dabe953 (patch)
tree579b9dbd9b05989950924d28977204adfb116ac9
parenta56d810e0574e6ef10ee63637d7bdf9081cecafa (diff)
downloadfirebase-ecommerce-6b0736a3e456d1eb1ba3c565a67ad0e09dabe953.tar.xz
firebase-ecommerce-6b0736a3e456d1eb1ba3c565a67ad0e09dabe953.zip
Adjusted Grid Size for Single Product and Updated Dashboard JS for Displaying Single Product Correctly
-rw-r--r--dashboard/index.html2
-rw-r--r--shared/Dashboard.js7
2 files changed, 7 insertions, 2 deletions
diff --git a/dashboard/index.html b/dashboard/index.html
index 4c07e8e..6fef2fc 100644
--- a/dashboard/index.html
+++ b/dashboard/index.html
@@ -85,7 +85,7 @@
}
.productDetail {
display: grid;
- grid-template-columns: auto auto;
+ grid-template-columns: 50% auto;
padding: 50px 0px;
}
.picture {
diff --git a/shared/Dashboard.js b/shared/Dashboard.js
index c995df8..5fb42a0 100644
--- a/shared/Dashboard.js
+++ b/shared/Dashboard.js
@@ -41,7 +41,12 @@ $(document).ready(function(){
}
function loadProduct (productid) {
$.getJSON("../products.json", function(result){
- $('#loader').append('<div class="productDetail"><div class="picture" style="background-image: url('+')"></div><div class="content"><h1>Title</h1><ul><li>Point 1</li><li>Point 2</li><li>Point 3</li><li>Point 4</li></ul><h3>$17.99</h3><button>Add to Cart</button></div></div>')
+ console.log(result[productid])
+ str = "";
+ for(i=0; i< Object.keys(result[productid].productDescription).length; i++) {
+ str += ('<li>' + result[productid].productDescription[i] + '</li>');
+ }
+ $('#loader').append('<div class="productDetail"><div class="picture" style="background-image:url(\''+result[productid].ProductImageURL+'\');"></div><div class="content"><h1>'+result[productid].productName+'</h1><ul>'+str+'</ul><h3>$17.99</h3><button>Add to Cart</button></div></div>');
})
}
function showErrorDiv() {