Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #6398 (new enhancement)

Opened 3 years ago

[PATCH] Add Touchpad control with some tests

Reported by: bwg1974 Assigned to: thomas@fesch.at
Priority: normal Milestone: 2.x
Component: script.aculo.us Version:
Severity: normal Keywords:
Cc:

Description

I've created a new control Touchpad (based heavily off of Slider). I also created a basic unit test (could use more) and a handful of functional tests to go with it.

It's a 2D control. Mousedown activates the control. Dragging the mouse sets the value. Mouseup or mouseout deactivates the control. The output value is an array [x, y].

// options: // axis: 'vertical', 'horizontal' (default is false) // rangeH: $R(min, max) (default is $R(0,1)) // minimumH: min (default is 0) // maximumH: max (default is 1) // rangeV: $R(min, max) (default is $R(0,1)) // minimumV: min (default is 0) // maximumV: max (default is 1) // valuesH: array of integers (default is false) // valuesV: array of integers (default is false)

// useCursors: true false (default is false) // inactiveCursor: valid cursor (default is 'pointer') // activeCursor: valid cursor (default is 'pointer') // disabledCursor: valid cursor (default is 'not-allowed') // callbacks: // onChange(value) // onTouch(value)

Known issues:

Mouseout fires inconsistently if the Touchpad contains children (that share an edge?). The sideeffect of not deactivating the control may or may not be desireable.

Attachments

add_touchpad_control_w_tests.diff (16.4 kB) - added by bwg1974 on 10/13/06 17:09:38.

Change History

10/13/06 17:09:38 changed by bwg1974

  • attachment add_touchpad_control_w_tests.diff added.