Skip to content

Commit

Permalink
Merge pull request #3 from nextmcloud/fix/loading-activity-app
Browse files Browse the repository at this point in the history
Only mount activity page when loading the view
  • Loading branch information
TSI-nareshrai authored Feb 28, 2022
2 parents 42054fc + 3221854 commit a7af3f3
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function escapeHTML(text) {
.split('\'').join(''')
}

$(function(){
(function(OCA){
OCA.Activity = OCA.Activity || {};

OCA.Activity.Filter = {
Expand Down Expand Up @@ -349,15 +349,22 @@ $(function(){

//OCA.Activity.Formatter.setAvatarStatus(OCA.Activity.InfinitScrolling.$container.data('avatars-enabled') === 'yes');
OC.Util.History.addOnPopStateHandler(_.bind(OCA.Activity.Filter._onPopState, OCA.Activity.Filter));
OCA.Activity.Filter.setFilter(OCA.Activity.InfinitScrolling.$container.attr('data-activity-filter'));
OCA.Activity.InfinitScrolling.$content.on('scroll', _.bind(OCA.Activity.InfinitScrolling.onScroll, OCA.Activity.InfinitScrolling));

OCA.Activity.Filter.$navigation.find('.nav-nmc_files_activity').on('click', function (event) {
var filter = 'all';
OC.Util.History.pushState({
filter: filter
});
OCA.Activity.Filter.setFilter(filter);
event.preventDefault();
});
});

OCA.Files = OCA.Files || {}

OCA.Files.FileActivityPlugin = {
name: 'nmc_files_activity',
attach: function() {
console.debug('Attached')
$('#app-content-nmc_files_activity').on('show.plugin-favorites', function(e) {
OCA.Activity.Filter.setFilter(OCA.Activity.InfinitScrolling.$container.attr('data-activity-filter'));
OCA.Activity.InfinitScrolling.$content.on('scroll', _.bind(OCA.Activity.InfinitScrolling.onScroll, OCA.Activity.InfinitScrolling));
})
},

detach: function() {
},
}
})(OCA);

OC.Plugins.register('OCA.Files.App', OCA.Files.FileActivityPlugin)

0 comments on commit a7af3f3

Please sign in to comment.