conteneurs.js (1945B)
1 (function($) { 2 widget(tk, { 3 hcontainer: function(_) { 4 _.options( 5 'class', '', 6 'autoWidth', [] 7 ); 8 9 _(this.autoWidth).addClass('auto-width'); 10 this['class'] += ' tk hcontainer-table'; 11 12 _.table(_, this, 13 _.tr('tk hcontainer-tr', 14 _('rest').remap(_.hcontainerCell, 'tk hcontainer-td'))); 15 }, 16 hcontainerCell: function(_) { 17 _.options('class', ''); 18 19 if (_('rest').is('.auto-width')) 20 this['class'] += ' auto-width'; 21 22 _.td(_, this, _('rest')) 23 }, 24 vcontainer: function(_) { 25 _.options( 26 'class', '', 27 'autoHeight', [] 28 ); 29 30 _(this.autoHeight).addClass('auto-height'); 31 this['class'] += ' tk vcontainer-table'; 32 33 _.table(_, this, 34 _('rest').remap(_.vcontainerCell, 'tk vcontainer-tr')); 35 }, 36 vcontainerCell: function(_) { 37 _.options('class', ''); 38 39 if (_('rest').is('.auto-height')) 40 this['class'] += ' auto-height'; 41 42 _.tr(_, this, 43 _.td('tk vcontainer-td', 44 _('rest'))); 45 }, 46 box: function(_) { 47 _.options( 48 null, 49 'hpos', false, 50 'vpos', false 51 ); 52 53 css = {}; 54 if (this.hpos) { css['text-align'] = this.hpos; } 55 if (this.vpos) { css['vertical-align'] = this.vpos; } 56 57 _.table('tk box-table', 58 _.tr('tk box-tr', 59 _.td(_, {class: 'tk box-td box', css: css }, 60 _('rest')))); 61 } 62 }); 63 })(jQuery);