mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-17 00:07:24 +00:00
Getting the tests working once more
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "TabsCtrl", ($scope, $rootScope, $location) ->
|
||||
Darkswarm.controller "TabsCtrl", ($scope, $rootScope, $location, OrderCycle) ->
|
||||
$scope.active = (path)->
|
||||
$location.hash() == path
|
||||
|
||||
@@ -12,29 +12,3 @@ Darkswarm.controller "TabsCtrl", ($scope, $rootScope, $location) ->
|
||||
$location.hash "/"
|
||||
else
|
||||
$location.hash tab.path
|
||||
|
||||
|
||||
# directive -> ng-click -> scope method (not isolated) -> toggle active | change location
|
||||
# watch active expression -> change tab appearance
|
||||
|
||||
#select = ->
|
||||
#$location.path(tab.path)
|
||||
|
||||
#active expression:
|
||||
#"$location.path() == tab.path"
|
||||
|
||||
|
||||
# directive -> ng-click -> set active (on isolated scope)
|
||||
# ng-class -> change tab appearance
|
||||
# two-way binding active attr <-> tab.active
|
||||
|
||||
# directive attr (select) -> scope.selectExpression
|
||||
# scope.select -> $parse ...
|
||||
#
|
||||
# in Directive
|
||||
# scope.select = $parse(attrs.select)
|
||||
# $scope.select($scope)
|
||||
#
|
||||
# 1: remove reverse binding on tab.active
|
||||
# 2: put $parse(attrs.select) onto tab
|
||||
# 3: override TabsetController/select to run tab.select() against original tab.$parent
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
Darkswarm.factory 'OrderCycle', ($resource, Product, orderCycleData) ->
|
||||
class OrderCycle
|
||||
@order_cycle = orderCycleData || {orders_close_at: ""}
|
||||
@order_cycle = orderCycleData || null
|
||||
@push_order_cycle: ->
|
||||
new $resource("/shop/order_cycle").save {order_cycle_id: @order_cycle.order_cycle_id}, (order_data)->
|
||||
OrderCycle.order_cycle.orders_close_at = order_data.orders_close_at
|
||||
Product.update()
|
||||
|
||||
@orders_close_at: ->
|
||||
if @order_cycle
|
||||
@order_cycle.orders_close_at
|
||||
else
|
||||
""
|
||||
@selected: ->
|
||||
@order_cycle != null
|
||||
|
||||
Reference in New Issue
Block a user