/** * This model is used by gallery/photo.blade.php, to handle comments and individual photo actions. * @constructor */ function PhotoViewModel() { this.el = '#photo-app'; this.data = { is_reply_form_loading: false, reply_comment_id: 0 }; this.methods = { replyToComment: function(e) { var replyButton = $(e.target).closest('.photo-comment'); this.reply_comment_id = replyButton.data('comment-id'); this.is_reply_form_loading = true; $('#comment-reply-modal').modal('show'); } }; }