www

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

commit 1b95adba9f43379004bd32e4e36404a8ff87ac56
parent 4f987e2f67aa5f38567ede8b1ade6ec9979cdde7
Author: gduperon <gduperon@5d9ba3ac-444b-4713-9fb3-0b58e79229a2>
Date:   Sat, 15 May 2010 21:10:54 +0000

ajustement auto hauteurs titres lors des redimensionnements, etc.

git-svn-id: https://projetud.info-ufr.univ-montp2.fr/svn/flin607-2009-gduperon@50 5d9ba3ac-444b-4713-9fb3-0b58e79229a2

Diffstat:
Mjside3/mvc/definition.js | 11++++-------
Mjside3/mvc/definitions.js | 10++++++++--
Mjside3/mvc/instance-bloc.js | 17++++++++++++++---
3 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/jside3/mvc/definition.js b/jside3/mvc/definition.js @@ -27,21 +27,18 @@ function MDéfinition() { }); } -blablabla = 0; -function VDéfinition(vInstanceBlocParente) { +function VDéfinition(vDéfinitionsParente) { $.extend(this,( $('#vue-définition') .jqote({}) .toDom())); this.vTitre = $('#vue-définition-titre').jqote({}); - vInstanceBlocParente.ajoutVDéfinition(this.vTitre, this); - - this.append(blablabla++); // Debug + vDéfinitionsParente.ajoutVDéfinition(this.vTitre, this); } -function CDéfinition(mDéfinition, vInstanceBlocParente) { +function CDéfinition(mDéfinition, vDéfinitionsParente) { this.modèle = mDéfinition; - this.vue = new VDéfinition(vInstanceBlocParente); + this.vue = new VDéfinition(vDéfinitionsParente); var that = this; this.vue.zonable({ diff --git a/jside3/mvc/definitions.js b/jside3/mvc/definitions.js @@ -4,7 +4,8 @@ function VDéfinitions(vInstanceBlocParente) { $.extend(this,( $('#vue-définitions') .jqote({}) - .appendTo(vInstanceBlocParente))); + .toDom())); + vInstanceBlocParente.setVDéfinitions(this); this.vTitresTabs = this.find('.définitions.vTitresTabs'); this.vBoutonNouvelleDéfinition = this.find('.définitions.vNouvelle-définition'); @@ -28,6 +29,7 @@ function VDéfinitions(vInstanceBlocParente) { that.changerTab(vtd, vcd); }); this.changerTab(vtd, vcd); + this.ajusterBarreTitres(); return vcd; }; @@ -38,7 +40,11 @@ function VDéfinitions(vInstanceBlocParente) { contenuTab.show(); }; - this.vContenusTabs.css('top', this.vTitresTabs.outerHeight()); + this.ajusterBarreTitres = function() { + that.vContenusTabs.css('top', that.vTitresTabs.outerHeight()); + } + + this.ajusterBarreTitres(); } function CDéfinitions(mInstanceBloc, vInstanceBlocParente) { diff --git a/jside3/mvc/instance-bloc.js b/jside3/mvc/instance-bloc.js @@ -23,9 +23,15 @@ function VInstanceBloc(vDéfinitionParente) { this.vÉditionTitre = this.find('.instance-bloc.vÉdition-titre'); this.vChampTitre = this.find('.instance-bloc.vChamp-titre'); this.vBoutonValiderTitre = this.find('.instance-bloc.vBoutonValiderTitre'); + this.vDéfinitions_ = this.find('.instance-bloc.vDéfinitions'); // quick hack because otherwise tabs titles disapear (???) this.vDéfinitions = this.find('.instance-bloc.vDéfinitions'); var that = this; + this.setVDéfinitions = function(vDéfinitions) { + this.vDéfinitions_.append(vDéfinitions); // quick hack because otherwise tabs titles disapear (???) + this.vDéfinitions = vDéfinitions; + } + this.titre = function(val) { if (typeof val != "function") { this.vTitre.text(val); @@ -48,11 +54,16 @@ function VInstanceBloc(vDéfinitionParente) { } this.ajusterBarreTitre = function() { - this.vDéfinitions.css('top', this.vBarreTitre.outerHeight()); + that.vDéfinitions.css('top', that.vBarreTitre.outerHeight()); } this.draggable(); - this.resizable(); + this.resizable({ + resize: function() { + that.ajusterBarreTitre(); + that.vDéfinitions.ajusterBarreTitres(); + } + }); this.vÉditionTitre.hide(); this.ajusterBarreTitre(); } @@ -80,5 +91,5 @@ function CInstanceBloc(mInstanceBloc, vDéfinitionParente) { this.vue.width(this.modèle.rect.width / this.modèle.rectParent.width * vDéfinitionParente.width()); this.vue.height(this.modèle.rect.height / this.modèle.rectParent.height * vDéfinitionParente.height()); - new CDéfinitions(this.modèle, this.vue.vDéfinitions); + new CDéfinitions(this.modèle, this.vue); }