diff --git a/ko-cart/js/viewmodel.js b/ko-cart/js/viewmodel.js index fd461fb..5f01a72 100644 --- a/ko-cart/js/viewmodel.js +++ b/ko-cart/js/viewmodel.js @@ -1,5 +1,9 @@ -"use strict"; var vm = (function () { + "use strict"; + + var visibleCatalog = ko.observable(true); + var visibleCart = ko.observable(false); + var catalog = ko.observableArray([ Product(1, "T-Shirt", 10.0, 20), Product(2, "Trousers", 20.0, 10), @@ -25,6 +29,8 @@ var vm = (function () { ); catalog.push(product); clearNewProduct(); + $('#addToCatalogModal').modal('hide'); + }; var searchTerm = ko.observable(""); @@ -116,8 +122,6 @@ var vm = (function () { $("#finishOrderModal").modal("show"); }; - var visibleCatalog = ko.observable(true); - var visibleCart = ko.observable(false); return { // first chapter