Merge pull request #4901 from dannon/fix_jquery_dragdrop_collections

Fix list collection creator dragdrop event bindings.
This commit is contained in:
John Chilton
2017-11-01 13:05:53 -04:00
committed by GitHub
9 changed files with 38 additions and 16 deletions
@@ -40,10 +40,23 @@ TODO:
},
render: function() {
this.$el
this.dragStartHandler = _.bind(this._dragstart, this);
this.dragEndHandler = _.bind(this._dragend, this);
var handle = this.$el
.attr("data-element-id", this.element.id)
.attr("draggable", true)
.html(this.template({ element: this.element }));
.html(this.template({ element: this.element }))
.get(0);
handle.addEventListener(
"dragstart",
this.dragStartHandler,
false
);
handle.addEventListener(
"dragend",
this.dragEndHandler,
false
);
if (this.selected) {
this.$el.addClass("selected");
}
@@ -102,8 +115,6 @@ TODO:
"click .name": "_clickName",
"click .discard": "_clickDiscard",
dragstart: "_dragstart",
dragend: "_dragend",
dragover: "_sendToParent",
drop: "_sendToParent"
},
@@ -46,17 +46,28 @@ currPanel.once( 'rendered', function(){
),
render: function() {
this.$el
this.dragStartHandler = _.bind(this._dragstart, this);
this.dragEndHandler = _.bind(this._dragend, this);
var handle = this.$el
.attr("draggable", true)
.data("pair", this.pair)
.html(this.template({ pair: this.pair }))
.addClass("flex-column-container");
.addClass("flex-column-container")
.get(0);
handle.addEventListener(
"dragstart",
this.dragStartHandler,
false
);
handle.addEventListener(
"dragend",
this.dragEndHandler,
false
);
return this;
},
events: {
dragstart: "_dragstart",
dragend: "_dragend",
dragover: "_sendToParent",
drop: "_sendToParent"
},
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long