Skip to content

Commit

Permalink
Fixed issue where the scope of the containment for the draggable item…
Browse files Browse the repository at this point in the history
…s wasn't tied to the component view. If more than one PPQ was rendered on the page, the pins would be lost on the subsequent components once a user attempted to drag a pin.
  • Loading branch information
danielghost committed Jun 7, 2017
1 parent 6e26213 commit 31662c4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/adapt-ppq.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,14 @@ define(function(require) {
},

onQuestionRendered:function() {
this.$('.ppq-pinboard-container-inner').imageready(_.bind(function() {
var $pinboardContainerInner = this.$('.ppq-pinboard-container-inner');

$pinboardContainerInner.imageready(_.bind(function() {
for (var i=0, l=this._pinViews.length; i<l; i++) {
var pin = this._pinViews[i];

pin.dragObj = new Draggabilly(pin.el, {
containment:'.ppq-pinboard-container-inner'
containment: $pinboardContainerInner
});

if (!this.model.get('_isEnabled')) pin.dragObj.disable();
Expand Down

0 comments on commit 31662c4

Please sign in to comment.