mirror of
https://github.com/wassname/fullcalendar.git
synced 2026-08-12 12:00:40 +08:00
Bind the drag related events in render instead of on init so that they
are rebound after being unbound by destroy.
This commit is contained in:
+8
-4
@@ -45,10 +45,9 @@ View.prototype = {
|
||||
this.widgetContentClass = tm + '-widget-content';
|
||||
this.highlightStateClass = tm + '-state-highlight';
|
||||
|
||||
// save reference to `this`-bound handlers and attach to document
|
||||
$(document)
|
||||
.on('mousedown', this.documentMousedownProxy = $.proxy(this, 'documentMousedown'))
|
||||
.on('dragstart', this.documentDragStartProxy = $.proxy(this, 'documentDragStart')); // jqui drag
|
||||
// save references to `this`-bound handlers
|
||||
this.documentMousedownProxy = $.proxy(this, 'documentMousedown');
|
||||
this.documentDragStartProxy = $.proxy(this, 'documentDragStart');
|
||||
},
|
||||
|
||||
|
||||
@@ -57,6 +56,11 @@ View.prototype = {
|
||||
render: function() {
|
||||
this.updateSize();
|
||||
this.trigger('viewRender', this, this, this.el);
|
||||
|
||||
// attach handlers to document. do it here to allow for destroy/rerender
|
||||
$(document)
|
||||
.on('mousedown', this.documentMousedownProxy)
|
||||
.on('dragstart', this.documentDragStartProxy); // jqui drag
|
||||
},
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user