Skip to Content
Menu
This question has been flagged
1 Reply
1999 Views

There is this function in thread.js and I need to change 2 things in it.

  1. ORDER.ASC should be ORDER.DECS
  2. and changes should only be applied to 'Discuss' channel.

very new to JS so need some help

init: function (parent, options) {
    this._super.apply(this, arguments);
    this.options = _.defaults(options || {}, {
        display_order: ORDER.ASC,
        display_needactions: true,
        display_stars: true,
        display_document_link: true,
        display_avatar: true,
        shorten_messages: true,
        squash_close_messages: true,
        display_reply_icon: false,
    });
    this.expanded_msg_ids = [];
    this.selected_id = null;
},
Avatar
Discard
Best Answer

Hi,
please try this and tell me the output : 

init: function (parent, options) {

        this._super.apply(this, arguments);

        if (this.view.model == 'Your.model'){

            options.display_order = ORDER.DESC,

            this.options = _.extend(this.options || {}, options || {});

        }

}

p.s : i'm not sure of the condition, so you may want to modify that. 

If it does not, you can tell me to try other changes. 

Thanks.

Avatar
Discard
Related Posts Replies Views Activity
1
Dec 24
130
2
Nov 24
85
1
Oct 24
267
0
Sep 24
213
2
Sep 24
648