www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

fenetre.js (1694B)


      1 (function($) {
      2     widget(tk, {
      3         window: function(_) {
      4             _.options(
      5                 'titre',   'Titre',
      6                 'contenu', 'Contenu',
      7                 'pied',    '',
      8                 null,
      9                 'width', 300,
     10                 'height', 150,
     11                 'canReduce', true,
     12                 'canClose',  true,
     13                 'canDock',   true
     14             );
     15             
     16             _.vcontainer('tk window', [1],
     17                          _.barreTitre(this.titre, this.canClose, this.canReduce),
     18                          _.div('tk contenu', _.box(this.contenu)),
     19                          _.div('tk pied',    _.box(this.pied)))
     20                 
     21                 .width(this.width)
     22                 .height(this.height)
     23                 .draggable()
     24                 .resizable({
     25                     resize: function(i,e) {
     26                         return $(this)
     27                             .trigger('sizeChange')
     28                             .find('*')
     29                             .trigger('sizeChange')
     30                             .trigger('posChange');
     31                     }
     32                 });
     33             
     34             if (!this.canClose) {
     35                 fermer.hide();
     36             }
     37         },
     38         barreTitre: function(_) {
     39             _.options(
     40                 'titre', 'Titre',
     41                 'canClose',  true,
     42                 'canReduce', true
     43             );
     44             
     45             _.hcontainer('tk barre-titre', [1],
     46                          fermer  = _.boutonFermer('tk fermer'),
     47                          titre   = _.div('tk titre',   this.titre),
     48                          reduire = _.boutonReduire('tk reduire'));
     49         },
     50     });
     51 })(jQuery);