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.

footer.js 820 B

1234567891011121314151617181920212223242526
  1. // a simple footer
  2. // args - parent, columns, items
  3. // items as [{column:1, label:'x', description:'y', onclick:function}]
  4. wn.widgets.Footer = function(args) {
  5. $.extend(this, args);
  6. this.make = function() {
  7. this.wrapper = $a(this.parent, 'div', 'std-footer');
  8. this.table = make_table(this.wrapper, 1, this.columns, [], {width:100/this.columns + '%'});
  9. this.render_items();
  10. }
  11. this.render_items = function() {
  12. for(var i=0; i<this.items.length; i++) {
  13. var item = this.items[i];
  14. var div = $a($td(this.table,0,item.column), 'div', 'std-footer-item');
  15. div.label = $a($a(div,'div'),'span','link_type','',item.label);
  16. div.label.onclick = item.onclick;
  17. if(item.description) {
  18. div.description = $a(div,'div','field_description','',item.description);
  19. }
  20. }
  21. }
  22. if(this.items)
  23. this.make();
  24. }