-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added require.js and search item by name
- Loading branch information
Showing
15 changed files
with
632 additions
and
483 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
<div class="small-screen-hide col-md-2 sticky-categories"> | ||
<p style="margin-bottom: 12px">Categories</p> | ||
|
||
<div class="small-screen-hide col-md-2"> | ||
<div class="list-group sticky-categories"> | ||
<a | ||
ng-click="changeCategory({newCategory:category})" | ||
class="list-group-item list-group-item-action" | ||
ng-repeat="category in categories" | ||
ng-class="{ active: category === currentCategory }" | ||
> | ||
{{category}} | ||
</a> | ||
</div> | ||
</div> | ||
<div class="list-group"> | ||
<a | ||
ng-click="changeCategory({newCategory:category})" | ||
class="list-group-item list-group-item-action" | ||
ng-repeat="category in categories" | ||
ng-class="{ active: category === currentCategory }" | ||
> | ||
{{category}} | ||
</a> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
var oldMenu = angular.module("oldMenu", ["ngRoute", 'ui.bootstrap']); | ||
define(["angular", "angular-route", "ui-bootstrap"], function (angular) { | ||
return angular.module("oldMenu", ["ngRoute", "ui.bootstrap"]); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
oldMenu.controller("bodyController", [ | ||
define(["app"], function (oldMenu) { | ||
oldMenu.controller("bodyController", [ | ||
"$scope", | ||
"cartService", | ||
"cacheService", | ||
function ($scope, cartService, cacheService) { | ||
$scope.isCartOpen = false; | ||
$scope.cart = cartService.cart; | ||
|
||
$scope.$watch('cart', function(newValue) { | ||
cacheService.setData('cart', newValue); | ||
}, true); | ||
$scope.$watch( | ||
"cart", | ||
function (newValue) { | ||
cacheService.setData("cart", newValue); | ||
}, | ||
true | ||
); | ||
|
||
$scope.toggleCartVisibility = function () { | ||
$scope.isCartOpen = !$scope.isCartOpen; | ||
}; | ||
|
||
$scope.getCartQuantity = cartService.getCartQuantity; | ||
$scope.changeItemQuantityInCart = cartService.changeItemQuantityInCart; | ||
$scope.getCartSubtotal = cartService.getCartSubtotal; | ||
$scope.getCartSubtotalWithoutDiscount = | ||
cartService.getCartSubtotalWithoutDiscount; | ||
}, | ||
]); | ||
]); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,28 @@ | ||
oldMenu.controller("ModalController", [ | ||
"$scope", | ||
"$uibModal", | ||
"cartService", | ||
function ($scope, $uibModal, cartService) { | ||
$scope.openModal = function () { | ||
var modalInstance = $uibModal.open({ | ||
templateUrl: "checkoutModal.htm", | ||
controller: "ModalInstanceController", | ||
size: "lg", | ||
resolve: { | ||
cartService: cartService, | ||
}, | ||
}); | ||
define(["app"], function (oldMenu) { | ||
oldMenu.controller("ModalController", [ | ||
"$scope", | ||
"$uibModal", | ||
"cartService", | ||
function ($scope, $uibModal, cartService) { | ||
$scope.openModal = function () { | ||
var modalInstance = $uibModal.open({ | ||
templateUrl: "checkoutModal.htm", | ||
controller: "ModalInstanceController", | ||
size: "lg", | ||
resolve: { | ||
cartService: cartService, | ||
}, | ||
}); | ||
|
||
modalInstance.result.then( | ||
function (selectedItem) { | ||
$scope.selected = selectedItem; | ||
}, | ||
function () { | ||
console.log("Modal dismissed"); | ||
} | ||
); | ||
}; | ||
}, | ||
]); | ||
|
||
oldMenu.controller("ModalInstanceController", [ | ||
"$scope", | ||
"$uibModalInstance", | ||
"cartService", | ||
function ($scope, $uibModalInstance, cartService) { | ||
$scope.cart = cartService.cart; | ||
|
||
$scope.getCartSubtotal = cartService.getCartSubtotal; | ||
console.log($scope.getCartSubtotal); | ||
|
||
$scope.ok = function () { | ||
$uibModalInstance.close("Some result"); | ||
}; | ||
|
||
$scope.cancel = function () { | ||
$uibModalInstance.dismiss("cancel"); | ||
}; | ||
}, | ||
]); | ||
modalInstance.result.then( | ||
function (selectedItem) { | ||
$scope.selected = selectedItem; | ||
}, | ||
function () { | ||
console.log("Modal dismissed"); | ||
} | ||
); | ||
}; | ||
}, | ||
]); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
define(["app"], function (oldMenu) { | ||
oldMenu.controller("ModalInstanceController", [ | ||
"$scope", | ||
"$uibModalInstance", | ||
"cartService", | ||
function ($scope, $uibModalInstance, cartService) { | ||
$scope.cart = cartService.cart; | ||
|
||
$scope.getCartSubtotal = cartService.getCartSubtotal; | ||
|
||
$scope.ok = function () { | ||
$uibModalInstance.close("Some result"); | ||
}; | ||
|
||
$scope.cancel = function () { | ||
$uibModalInstance.dismiss("cancel"); | ||
}; | ||
}, | ||
]); | ||
}); |
Oops, something went wrong.