29 // contain the handles correctly - we cannot set |
29 // contain the handles correctly - we cannot set |
30 // containment: parent because it wouldn't allow to select the |
30 // containment: parent because it wouldn't allow to select the |
31 // whole slice, so we have to compute a box in which the slice is |
31 // whole slice, so we have to compute a box in which the slice is |
32 // allowed to move. |
32 // allowed to move. |
33 var containment = [left - 8, top, this.selector.width() + left, top]; |
33 var containment = [left - 8, top, this.selector.width() + left, top]; |
34 console.log(containment); |
34 |
35 //if (browser. |
|
36 // var containment = [left - 16, top, this.selector.width() + left - 8, top]; |
35 // var containment = [left - 16, top, this.selector.width() + left - 8, top]; |
37 this.leftHandle.draggable({axis: "x", |
36 this.leftHandle.draggable({axis: "x", |
38 drag: IriSP.wrap(this, this.leftHandleDragged), |
37 drag: IriSP.wrap(this, this.leftHandleDragged), |
39 containment: containment |
38 containment: containment |
40 }); |
39 }); |
43 // containment = [left, top, this.selector.width() + left - 8, top]; |
42 // containment = [left, top, this.selector.width() + left - 8, top]; |
44 this.rightHandle.draggable({axis: "x", |
43 this.rightHandle.draggable({axis: "x", |
45 drag: IriSP.wrap(this, this.rightHandleDragged), |
44 drag: IriSP.wrap(this, this.rightHandleDragged), |
46 containment: containment |
45 containment: containment |
47 }); |
46 }); |
48 } else { /* firefox */ |
47 |
49 |
48 } else { // firefox |
|
49 // we need to define a containment specific to firefox. |
|
50 |
|
51 var containment = [left - 16, top, this.selector.width() + left - 8, top]; |
50 this.leftHandle.draggable({axis: "x", |
52 this.leftHandle.draggable({axis: "x", |
51 drag: IriSP.wrap(this, this.leftHandleDragged), |
53 drag: IriSP.wrap(this, this.leftHandleDragged), |
52 containment: parent |
54 containment: containment |
53 }); |
55 }); |
54 |
56 |
|
57 containment = [left, top, this.selector.width() + left - 8, top]; |
55 this.rightHandle.draggable({axis: "x", |
58 this.rightHandle.draggable({axis: "x", |
56 drag: IriSP.wrap(this, this.rightHandleDragged), |
59 drag: IriSP.wrap(this, this.rightHandleDragged), |
57 containment: parent |
60 containment: containment |
58 }); |
61 }); |
59 } |
62 } |
60 |
63 |
61 this.leftHandle.css("position", "absolute"); |
64 this.leftHandle.css("position", "absolute"); |
62 this.rightHandle.css("position", "absolute"); |
65 this.rightHandle.css("position", "absolute"); |