clientIO / JointJS_plus

JointJS+ support
4 stars 9 forks source link

Trigger selection-box:pointermove and selection-box:pointerup in SelectionView #25

Closed DavidDurman closed 10 years ago

DavidDurman commented 10 years ago

i’d like to request a really simple enhancement to the SelectionView component.

So currently, there is a pointerdown event, but there is no pointer move or pointerup events.

I went into the code, and as far as i could tell, adding this functionality is pretty straight forward.

I would love to see it implemented into the standard library as hooks for events in the selection view.

If the plan is not to do that, is there a way I can extend these functions without having to copy a whole bunch of code into another js file…thus if the selection view component has massive changes in the future, my version won’t work? I guess it’s not as easy as extending the models?

Here are the two areas i was looking at….

    in the stopSelecting function

        case 'translating':
            this.options.graph.trigger('batch:stop');
            // Everything else is done during the translation.

            // **** Add the selection-box:pointerup event, pass back the model ****//
            this.trigger('selection-box:pointerup', this.model);

        break;

The other area is in the adjustSelection function, right at the end of the translating action

    this.trigger(‘selection-box:pointermove’, this.model)
kmansel commented 10 years ago

Awesome!

DavidDurman commented 10 years ago

Done. It's exactly as you suggested. Will be part of the next release. Thanks!