mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-07-09 02:57:48 +02:00
1228e42fc7
-> création d'un fichier functions.js pour extraire la partie LSdebug de LSdefault.js. -> création d'une méthode getFData() sensiblement la même quand PHP - LSformElement_text : Création d'une possibilité d'auto-génération en JS de la valeur à partir des autres champs du formulaire. - LSconfirmBox && LSsmoothbox : -> ajout d'une méthode positionWhenScrolling() pour le placement de la box lors du scroll - LSconfirmBox : Correction d'un bug IE à la fermeture
54 lines
1.6 KiB
JavaScript
54 lines
1.6 KiB
JavaScript
var LSformElement_text_field = new Class({
|
|
initialize: function(name,input,parent){
|
|
this.name = name;
|
|
this.parent = parent;
|
|
this.input = input;
|
|
this.params = varLSdefault.LSjsConfig[this.name];
|
|
this._auto=1;
|
|
this.input.addEvent('change',this.unauto.bind(this));
|
|
},
|
|
|
|
start: function() {
|
|
var force=0;
|
|
if ($type(this.params)) {
|
|
if (this.params.autoGenerateOnModify) {
|
|
force = 1;
|
|
}
|
|
}
|
|
if ((this.input.value=='')||(force)) {
|
|
if ($type(this.params)) {
|
|
if ($type(this.params['generate_value_format'])) {
|
|
this.format = this.params['generate_value_format'];
|
|
this.dependsFields = this.parent.getDependsFields(this.format);
|
|
this.dependsFields.each(function(el) {
|
|
var input = this.parent.getInput.bind(this.parent)(el);
|
|
input.addEvent('change',this.refreshValue.bind(this));
|
|
},this);
|
|
this.fx = new Fx.Tween(this.input,{property: 'background-color',duration:600});
|
|
}
|
|
}
|
|
}
|
|
},
|
|
|
|
getInput: function() {
|
|
return this.input;
|
|
},
|
|
|
|
getValue: function() {
|
|
return this.input.value;
|
|
},
|
|
|
|
refreshValue: function() {
|
|
if (this._auto) {
|
|
this.input.value=getFData(this.format,this.parent,'getValue');
|
|
this.oldBg=this.input.getStyle('background-color');
|
|
this.fx.start('#f16d6d');
|
|
(function() {this.fx.start(this.oldBg);}).delay(1000,this);
|
|
}
|
|
},
|
|
|
|
unauto: function() {
|
|
this._auto=0;
|
|
}
|
|
});
|