You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dashboard.js 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. var oscar = oscar || {};
  2. oscar.dashboard = {
  3. promotions: {
  4. init: function() {
  5. $('.promotion_list').sortable({
  6. handle: '.btn-handle',
  7. stop: oscar.dashboard.promotions.save_order});
  8. },
  9. save_order: function(event, ui) {
  10. // todo - save order of promotions
  11. console.log(event, ui);
  12. }
  13. }
  14. };
  15. $(document).ready(function()
  16. {
  17. //table font size increase decrease
  18. $('.fontsize li').click(function()
  19. {
  20. var os = $('.bordered-table').css('font-size');// find font size for p
  21. var uom = os.slice(-2);// finds the unit of mesure = pixles
  22. var num = parseFloat(os, 10);// gets rid of the px
  23. $('.bordered-table').css('font-size', num / 1.1 + uom);
  24. if (this.id == 'larger') {
  25. $('.bordered-table').css('font-size', num * 1.1 + uom);
  26. }
  27. });
  28. //side navigation accordion
  29. $('.primary-nav > li > ul, .orders_search').each(function(index)
  30. {
  31. $(this).css('height', $(this).height());
  32. });
  33. $(".primary-nav > li > ul, .orders_search").hide();
  34. $(".primary-nav > li > a").click(function()
  35. {
  36. $(this).next("ul").slideToggle("fast");
  37. $(this).toggleClass("viewed");
  38. });
  39. //pull out draw
  40. $(".pull_out").click(function()
  41. {
  42. $(this).parent("div").find('.orders_search').slideToggle("fast");
  43. $(this).toggleClass("viewed");
  44. });
  45. });