forked from 0x2620/oxjs
some bugfixes
This commit is contained in:
parent
4cc754a28d
commit
ef1fa5fe84
14 changed files with 228 additions and 229 deletions
|
|
@ -73,11 +73,11 @@ Ox.Range = function(options, self) {
|
|||
})
|
||||
.addClass('OxArrow')
|
||||
.bindEvent({
|
||||
mousedown: function(event, e) {
|
||||
clickArrow(e, i, true);
|
||||
mousedown: function(data) {
|
||||
clickArrow(data, i, true);
|
||||
},
|
||||
mouserepeat: function(event, e) {
|
||||
clickArrow(e, i, false);
|
||||
mouserepeat: function(data) {
|
||||
clickArrow(data, i, false);
|
||||
}
|
||||
})
|
||||
.appendTo(that.$element);
|
||||
|
|
@ -143,23 +143,23 @@ Ox.Range = function(options, self) {
|
|||
|
||||
setThumb();
|
||||
|
||||
function clickArrow(e, i, animate) {
|
||||
function clickArrow(data, i, animate) {
|
||||
// fixme: shift doesn't work, see menu scrolling
|
||||
setValue(self.options.value + self.options.arrowStep * (i == 0 ? -1 : 1) * (e.shiftKey ? 2 : 1), animate);
|
||||
setValue(self.options.value + self.options.arrowStep * (i == 0 ? -1 : 1) * (data.shiftKey ? 2 : 1), animate);
|
||||
}
|
||||
|
||||
function clickTrack(event, e) {
|
||||
function clickTrack(data) {
|
||||
// fixme: thumb ends up a bit too far on the right
|
||||
var isThumb = $(e.target).hasClass('OxThumb');
|
||||
var isThumb = $(edatatarget).hasClass('OxThumb');
|
||||
self.drag = {
|
||||
left: self.$track.offset().left,
|
||||
offset: isThumb ? e.clientX - self.$thumb.offset().left - 8 /*self.thumbSize / 2*/ : 0
|
||||
offset: isThumb ? data.clientX - self.$thumb.offset().left - 8 /*self.thumbSize / 2*/ : 0
|
||||
};
|
||||
setValue(getVal(e.clientX - self.drag.left - self.drag.offset), !isThumb);
|
||||
setValue(getVal(data.clientX - self.drag.left - self.drag.offset), !isThumb);
|
||||
}
|
||||
|
||||
function dragTrack(event, e) {
|
||||
setValue(getVal(e.clientX - self.drag.left - self.drag.offset))
|
||||
function dragTrack(data) {
|
||||
setValue(getVal(data.clientX - self.drag.left - self.drag.offset))
|
||||
}
|
||||
|
||||
function getPx(val) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue