Skip to content

Commit

Permalink
Merge pull request #172 from entrylabs/hotfix/select_picture_bug
Browse files Browse the repository at this point in the history
Hotfix/select picture bug
  • Loading branch information
chanlee committed Feb 5, 2016
2 parents 2b8f8fc + 7631b2a commit da34afe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions dist/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -9306,8 +9306,9 @@ Entry.Playground.prototype.selectPicture = function(a) {
var e = b[c];
e.id === a.id ? e.view.addClass("entryPictureSelected") : e.view.removeClass("entryPictureSelected");
}
b = Entry.container.selectPicture(a.id);
this.object.id === b && Entry.dispatchEvent("pictureSelected", a);
var f;
a && a.id && (f = Entry.container.selectPicture(a.id));
this.object.id === f && Entry.dispatchEvent("pictureSelected", a);
};
Entry.Playground.prototype.movePicture = function(a, b) {
this.object.pictures.splice(b, 0, this.object.pictures.splice(a, 1)[0]);
Expand Down
2 changes: 1 addition & 1 deletion dist/entry.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,10 @@ Entry.Playground.prototype.selectPicture = function(picture) {
target.view.removeClass('entryPictureSelected');
}

var objectId_ = Entry.container.selectPicture(picture.id);
var objectId_;
if(picture && picture.id) {
objectId_ = Entry.container.selectPicture(picture.id);
}

if( this.object.id === objectId_) {
Entry.dispatchEvent('pictureSelected', picture);
Expand Down

0 comments on commit da34afe

Please sign in to comment.