diff options
Diffstat (limited to 'apps/comments/src/activitytabviewplugin.js')
-rw-r--r-- | apps/comments/src/activitytabviewplugin.js | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/apps/comments/src/activitytabviewplugin.js b/apps/comments/src/activitytabviewplugin.js index b6195b80c45..2afee4c2be5 100644 --- a/apps/comments/src/activitytabviewplugin.js +++ b/apps/comments/src/activitytabviewplugin.js @@ -1,4 +1,4 @@ -/* +/** * @author Joas Schilling <coding@schilljs.com> * Copyright (c) 2016 * @@ -18,18 +18,18 @@ * @param {jQuery} $el jQuery handle for this activity * @param {string} view The view that displayes this activity */ - prepareModelForDisplay: function (model, $el, view) { + prepareModelForDisplay: function(model, $el, view) { if (model.get('app') !== 'comments' || model.get('type') !== 'comments') { - return; + return } if (view === 'ActivityTabView') { - $el.addClass('comment'); + $el.addClass('comment') if (model.get('message') && this._isLong(model.get('message'))) { - $el.addClass('collapsed'); - var $overlay = $('<div>').addClass('message-overlay'); - $el.find('.activitymessage').after($overlay); - $el.on('click', this._onClickCollapsedComment); + $el.addClass('collapsed') + var $overlay = $('<div>').addClass('message-overlay') + $el.find('.activitymessage').after($overlay) + $el.on('click', this._onClickCollapsedComment) } } }, @@ -38,22 +38,21 @@ * Copy of CommentsTabView._onClickComment() */ _onClickCollapsedComment: function(ev) { - var $row = $(ev.target); + var $row = $(ev.target) if (!$row.is('.comment')) { - $row = $row.closest('.comment'); + $row = $row.closest('.comment') } - $row.removeClass('collapsed'); + $row.removeClass('collapsed') }, /* * Copy of CommentsTabView._isLong() */ _isLong: function(message) { - return message.length > 250 || (message.match(/\n/g) || []).length > 1; + return message.length > 250 || (message.match(/\n/g) || []).length > 1 } - }; + } +})() -})(); - -OC.Plugins.register('OCA.Activity.RenderingPlugins', OCA.Comments.ActivityTabViewPlugin); +OC.Plugins.register('OCA.Activity.RenderingPlugins', OCA.Comments.ActivityTabViewPlugin) |