29 this.rightHandle.draggable({axis: "x", |
29 this.rightHandle.draggable({axis: "x", |
30 drag: IriSP.wrap(this, this.rightHandleDragged), |
30 drag: IriSP.wrap(this, this.rightHandleDragged), |
31 containment: "parent" |
31 containment: "parent" |
32 }); |
32 }); |
33 |
33 |
|
34 this.leftHandle.css("position", "absolute"); |
|
35 this.rightHandle.css("position", "absolute"); |
34 |
36 |
35 this._Popcorn.listen("IriSP.SliceWidget.position", |
37 this._Popcorn.listen("IriSP.SliceWidget.position", |
36 IriSP.wrap(this, this.positionSliceHandler)); |
38 IriSP.wrap(this, this.positionSliceHandler)); |
37 this._Popcorn.trigger("IriSP.SliceWidget.position", [57, 24]); |
39 this._Popcorn.trigger("IriSP.SliceWidget.position", [57, 24]); |
38 }; |
40 }; |
46 this.sliceZone.css("left", left + "px"); |
48 this.sliceZone.css("left", left + "px"); |
47 this.sliceZone.css("width", width + "px"); |
49 this.sliceZone.css("width", width + "px"); |
48 this.leftHandle.css("left", (left - 7) + "px"); |
50 this.leftHandle.css("left", (left - 7) + "px"); |
49 this.rightHandle.css("left", left + width + "px"); |
51 this.rightHandle.css("left", left + width + "px"); |
50 }; |
52 }; |
51 |
|
52 /* |
|
53 IriSP.SliceWidget.prototype.leftHandleDragged = function(event, ui) { |
|
54 var currentX = this.leftHandle.position()["left"]; |
|
55 |
|
56 var parentOffset = this.selector.offset(); |
|
57 var relX = event.pageX - parentOffset.left; |
|
58 |
|
59 |
|
60 var increment = this.zoneLeft - relX; |
|
61 console.log(increment); |
|
62 |
|
63 this.sliceZone.css("width", this.zoneWidth + increment); |
|
64 this.sliceZone.css("left", relX + "px"); |
|
65 this.zoneLeft = relX; |
|
66 this.zoneWidth += increment; |
|
67 }; |
|
68 */ |
|
69 |
53 |
70 /** handle a dragging of the left handle */ |
54 /** handle a dragging of the left handle */ |
71 IriSP.SliceWidget.prototype.leftHandleDragged = function(event, ui) { |
55 IriSP.SliceWidget.prototype.leftHandleDragged = function(event, ui) { |
72 var currentX = this.leftHandle.position()["left"]; |
56 var currentX = this.leftHandle.position()["left"]; |
73 |
57 |