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.
 
 
 
 
 
 

34 regels
950 B

  1. wn.provide('wn.pages.doclistview');
  2. wn.pages.doclistview.pages = {};
  3. wn.pages.doclistview.show = function(doctype) {
  4. var pagename = doctype + ' List';
  5. if(!wn.pages.doclistview.pages[pagename]) {
  6. var page = page_body.add_page(pagename);
  7. page.doclistview = new wn.pages.DocListView(doctype, page);
  8. wn.pages.doclistview.pages[pagename] = page;
  9. }
  10. page_body.change_to(pagename);
  11. }
  12. wn.pages.DocListView = Class.extend({
  13. init: function(doctype, page) {
  14. this.doctype = doctype;
  15. this.wrapper = page;
  16. this.label = get_doctype_label(doctype);
  17. this.label = (this.label.toLowerCase().substr(-4) == 'list') ?
  18. this.label : (this.label + ' List')
  19. this.make();
  20. },
  21. make: function() {
  22. $(this.wrapper).html('<div class="layout_wrapper">\
  23. <div class="header"></div>\
  24. <div class="filters">[filters]</div>\
  25. <div class="body">[body]</div>\
  26. </div>');
  27. new PageHeader($(this.wrapper).find('.header').get(0), this.label)
  28. }
  29. })