Add product ID to context of an action object
authorSteven Chan <steven3416@gmail.com>
Fri, 5 Sep 2014 18:17:42 +0000 (11:17 -0700)
committerSteven Chan <steven3416@gmail.com>
Fri, 5 Sep 2014 18:20:16 +0000 (11:20 -0700)
Potentially useful for a later refactor

Signed-off-by: Steven Chan <steven3416@gmail.com>
src/od_action.coffee
src/od_pages_myopac.coffee

index 89620fa..31b5ffc 100644 (file)
@@ -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 """
                        <div>
@@ -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
index 9902911..39446a9 100644 (file)
@@ -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