You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted the handles not to cross, but also not overlap. I understand that this would currently result in the fact that the range values will not be the same on left and right. Which is fine for my use-case.
I modified the function "validateAndMoveGripsToPx", and included a conditional statement tin the if statement (last part:)
'validateAndMoveGripsToPx': function(nextLeftGripPositionPx,nextRightGripPositionPx){var$this=this;//[! edit:settings=$this.data('settings');// added settings to get crossable_handles value// end edit !]vardraggableAreaLengthPx=_methods.getSliderWidthPx.call($this)-$this.data('left_grip_width');//// Validate & Move//if(nextRightGripPositionPx<=draggableAreaLengthPx&&nextLeftGripPositionPx>=0&&nextLeftGripPositionPx<=draggableAreaLengthPx&&(!$this.data('has_right_grip')||nextLeftGripPositionPx<=nextRightGripPositionPx// [! edit:// subtract the grip width to let the handles stop when they touch..-(!settings.crossable_handles ? $this.data('left_grip_width') : 0)// end edit!])){varprevMin=$this.data('cur_min'),prevMax=$this.data('cur_max');// note: also stores new cur_min, cur_max_methods.set_position_from_px.call($this,nextLeftGripPositionPx,nextRightGripPositionPx);// set the style of the grips according to the highlighted range_methods.refresh_grips_style.call($this);_methods.notify_changed_implicit.call($this,'drag_move',prevMin,prevMax);}return$this;},
Of course it would be beter if this was an additional setting, because now when not allowing to cross, it will always force the 'no touch' policy (actually a better name would be 'touch slightly only' 😄 )
The text was updated successfully, but these errors were encountered:
Given the custom style:
I wanted the handles not to cross, but also not overlap. I understand that this would currently result in the fact that the range values will not be the same on left and right. Which is fine for my use-case.
I modified the function "validateAndMoveGripsToPx", and included a conditional statement tin the if statement (last part:)
Of course it would be beter if this was an additional setting, because now when not allowing to cross, it will always force the 'no touch' policy (actually a better name would be 'touch slightly only' 😄 )
The text was updated successfully, but these errors were encountered: