Skip to content
This repository
Browse code

Add "select all" checkbox also in order items table

  • Loading branch information...
commit 2179eac13f807c26f5a6d5cc2bd2057072d58b37 1 parent 4b39ef0
paluh authored May 31, 2012
13  oscar/static/oscar/js/oscar/dashboard.js
@@ -31,11 +31,16 @@ oscar.dashboard = {
31 31
             }
32 32
         },
33 33
         initTable: function() {
34  
-            var table = $('form.order_table table'),
35  
-                input = $('<input type="checkbox" />');
36  
-            $('th:first', table).append(input);
  34
+            var table = $('form table'),
  35
+                input = $('<input type="checkbox" />').css({
  36
+                    'margin-right': '5px',
  37
+                    'vertical-align': 'top'
  38
+                });
  39
+            $('th:first', table).prepend(input);
37 40
             $(input).change(function(){
38  
-                $('input.selected_order', table).prop("checked", $(this).is(':checked'));
  41
+                $('tr', table).each(function() {
  42
+                    $('td:first input', this).prop("checked", $(input).is(':checked'));
  43
+                });
39 44
             });
40 45
         }
41 46
     },
1  oscar/templates/dashboard/orders/order_detail.html
@@ -471,4 +471,5 @@ <h3 class="app-ico ico_comment icon">Notes</h3>
471 471
 
472 472
 {% block onbodyload %}
473 473
 oscar.dashboard.orders.initTabs();
  474
+oscar.dashboard.orders.initTable();
474 475
 {% endblock %}

0 notes on commit 2179eac

Please sign in to comment.
Something went wrong with that request. Please try again.