diff --git a/app/assets/javascripts/darkswarm/controllers/edit_bought_order_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/edit_bought_order_controller.js.coffee index 4e41283c1e3..f6a0564ded5 100644 --- a/app/assets/javascripts/darkswarm/controllers/edit_bought_order_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/edit_bought_order_controller.js.coffee @@ -4,8 +4,8 @@ Darkswarm.controller "EditBoughtOrderController", ($scope, $resource, $timeout, $scope.deleteLineItem = (id) -> if Cart.has_one_line_item() - Messages.error(t 'orders_cannot_remove_the_final_item') - $scope.removeEnabled = false + Messages.error(t 'orders_cannot_remove_the_final_item') + $scope.removeEnabled = false $timeout (-> $scope.removeEnabled = true ), 10000 diff --git a/app/assets/javascripts/darkswarm/services/cart.js.coffee b/app/assets/javascripts/darkswarm/services/cart.js.coffee index 1717fa3f7b4..380f0ccc416 100644 --- a/app/assets/javascripts/darkswarm/services/cart.js.coffee +++ b/app/assets/javascripts/darkswarm/services/cart.js.coffee @@ -116,7 +116,8 @@ Darkswarm.factory 'Cart', (CurrentOrder, Variants, $timeout, $http, $modal, $roo localStorageService.clearAll() # One day this will have to be moar GRANULAR has_one_line_item: => - @line_items_finalised.length == 1 + @line_items_finalised.length == 1 + removeFinalisedLineItem: (id) => @line_items_finalised = @line_items_finalised.filter (item) -> item.id != id