Commit 63fc82f3 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Disable drag-drop within recent comments view.

parent 0f38bbbf
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -30,6 +30,11 @@ Ext.define('Docs.view.comments.List', {
     * Used in Docs.view.comments.FullList.
     */

    /**
     * @cfg {Boolean} enableDragDrop
     * True to allow drag-drop reorganization of comments.
     */

    initComponent: function() {
        this.store = Ext.create('Ext.data.Store', {
            model: "Docs.model.Comment",
@@ -39,7 +44,10 @@ Ext.define('Docs.view.comments.List', {
            }
        });

        this.tpl = Docs.view.comments.Template.create({showTarget: this.showTarget});
        this.tpl = Docs.view.comments.Template.create({
            showTarget: this.showTarget,
            enableDragDrop: this.enableDragDrop
        });

        this.callParent(arguments);

@@ -97,10 +105,12 @@ Ext.define('Docs.view.comments.List', {
        this.delegateClick("a.remove-tag", this.removeTag, this);

        // initialize drag-drop
        if (this.enableDragDrop) {
            new Docs.view.comments.DragZone(this);
            new Docs.view.comments.DropZone(this, {
                onValidDrop: Ext.Function.bind(this.setParent, this)
            });
        }
    },

    delegateClick: function(selector, callback, scope) {
+1 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ Ext.define('Docs.view.comments.ListWithForm', {
    initComponent: function() {
        this.items = [
            this.list = new Docs.view.comments.List({
                enableDragDrop: true
            })
        ];

+6 −1
Original line number Diff line number Diff line
@@ -33,6 +33,11 @@ Ext.define('Docs.view.comments.Template', {
     * True to show a link to the target in each comment.
     */

    /**
     * @cfg {Boolean} enableDragDrop
     * True to allow drag-drop reorganization of comments.
     */

    constructor: function() {
        this.callParent([
            '<div>',
@@ -90,7 +95,7 @@ Ext.define('Docs.view.comments.Template', {

    avatar: function(emailHash) {
        // turns avatars into drag-handles for moderators.
        return Docs.Comments.avatar(emailHash, this.isMod() ? "drag-handle" : "");
        return Docs.Comments.avatar(emailHash, this.isMod() && this.enableDragDrop ? "drag-handle" : "");
    },

    isTargetVisible: function() {