1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| dojo.declare(
"DndElement",
{
//proprietes de la classe
_node : null,
_target : null,
_source : null,
_myMoveable :null,
_verifDnd :null,
//constructor
constructor : function (source, elementDroppe, target, myMoveable, verifDnd) {
this._source = source;
this._node = elementDroppe;
this._target = target;
this._myMoveable = myMoveable;
this._verifDnd = verifDnd;
console.log("constructeur show moveable ", this._myMoveable);
},
// methodes
annuler : function () {
/**
*if this._verifDnd is verified= true donc:
*on destroy le moveable
*/
if (this._verifDnd) {
// destroy the moveable
this._myMoveable.destroy();
}
},
retablir : function () {
/**
*if this._verifDnd is verified = true donc:
*on recree le moveable sur le this._node
*/
if (this._verifDnd) {
// recrer moveable sur le node passé en parametre de constructeur
var monMoveable = new dojo.dnd.Moveable( this._node);
this._myMoveable = monMoveable;
}
}
}); |
Partager