|
|
@@ -203,23 +203,29 @@ Grid.mixin({
|
|
|
------------------------------------------------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
- // Attaches event-element-related handlers to the container element and leverage bubbling
|
|
|
+ // Attaches event-element-related handlers for *all* rendered event segments of the view.
|
|
|
bindSegHandlers: function() {
|
|
|
- this.bindSegHandler('touchstart', this.handleSegTouchStart);
|
|
|
- this.bindSegHandler('touchend', this.handleSegTouchEnd);
|
|
|
- this.bindSegHandler('mouseenter', this.handleSegMouseover);
|
|
|
- this.bindSegHandler('mouseleave', this.handleSegMouseout);
|
|
|
- this.bindSegHandler('mousedown', this.handleSegMousedown);
|
|
|
- this.bindSegHandler('click', this.handleSegClick);
|
|
|
+ this.bindSegHandlersToEl(this.el);
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ // Attaches event-element-related handlers to an arbitrary container element. leverages bubbling.
|
|
|
+ bindSegHandlersToEl: function(el) {
|
|
|
+ this.bindSegHandlerToEl(el, 'touchstart', this.handleSegTouchStart);
|
|
|
+ this.bindSegHandlerToEl(el, 'touchend', this.handleSegTouchEnd);
|
|
|
+ this.bindSegHandlerToEl(el, 'mouseenter', this.handleSegMouseover);
|
|
|
+ this.bindSegHandlerToEl(el, 'mouseleave', this.handleSegMouseout);
|
|
|
+ this.bindSegHandlerToEl(el, 'mousedown', this.handleSegMousedown);
|
|
|
+ this.bindSegHandlerToEl(el, 'click', this.handleSegClick);
|
|
|
},
|
|
|
|
|
|
|
|
|
// Executes a handler for any a user-interaction on a segment.
|
|
|
// Handler gets called with (seg, ev), and with the `this` context of the Grid
|
|
|
- bindSegHandler: function(name, handler) {
|
|
|
+ bindSegHandlerToEl: function(el, name, handler) {
|
|
|
var _this = this;
|
|
|
|
|
|
- this.el.on(name, '.fc-event-container > *', function(ev) {
|
|
|
+ el.on(name, '.fc-event-container > *', function(ev) {
|
|
|
var seg = $(this).data('fc-seg'); // grab segment data. put there by View::renderEvents
|
|
|
|
|
|
// only call the handlers if there is not a drag/resize in progress
|