From e2ef6d2a3cba770d71c936e694ecf5048e9f17cd Mon Sep 17 00:00:00 2001 From: Steven Chan Date: Fri, 5 Sep 2014 11:17:42 -0700 Subject: [PATCH] Add product ID to context of an action object Potentially useful for a later refactor Signed-off-by: Steven Chan --- src/od_action.coffee | 4 ++-- src/od_pages_myopac.coffee | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/od_action.coffee b/src/od_action.coffee index 89620fa..31b5ffc 100644 --- a/src/od_action.coffee +++ b/src/od_action.coffee @@ -289,7 +289,7 @@ define [ # Build action buttons and dialogs given specifications as follows. # actions = [ { name: { href: h, method: m, fields: [ { name: n, value: v, options: [...] } ] } ] - _actions: (actions) -> + _actions: (actions, id) -> tpl = _.template """
@@ -303,7 +303,7 @@ define [ $buttons = for n, action of actions # Extend the action object with context - $.extend action, _of: $tr, _name: n + $.extend action, _of: $tr, _name: n, _id: id # Create a button for this action $ tpl href: action.href, action_name: n, label: Labels?[n] or n diff --git a/src/od_pages_myopac.coffee b/src/od_pages_myopac.coffee index 9902911..39446a9 100644 --- a/src/od_pages_myopac.coffee +++ b/src/od_pages_myopac.coffee @@ -273,7 +273,7 @@ define [ ._holds_row_avail1 hold .end() .find 'td.actions' - ._actions hold.actions + ._actions hold.actions, hold.reserveId .end() # Show a title, author, or format by using the given metadata object @@ -436,10 +436,10 @@ define [ ._checkouts_row_avail circ .end() .find 'td.actions' - ._actions circ.actions + ._actions circ.actions, circ.reserveId .end() .find 'td.formats' - ._formats circ.formats + ._formats circ.formats, circ.reserveId .end() _checkouts_row_avail: (circ) -> @@ -509,7 +509,7 @@ define [ # Build action buttons .find 'td.actions' - ._actions avail.actions + ._actions avail.actions, avail.id .end() # Illuminate areas of this row according to the holdings status -- 2.11.0