Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
ed88515d
Commit
ed88515d
authored
Nov 19, 2016
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convert activities.js to es6 class syntax
parent
171ece8f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
33 deletions
+31
-33
app/assets/javascripts/activities.js.es6
app/assets/javascripts/activities.js.es6
+25
-27
app/assets/javascripts/dispatcher.js.es6
app/assets/javascripts/dispatcher.js.es6
+3
-3
app/assets/javascripts/user_tabs.js.es6
app/assets/javascripts/user_tabs.js.es6
+1
-1
app/views/projects/_activity.html.haml
app/views/projects/_activity.html.haml
+1
-1
spec/javascripts/activities_spec.js.es6
spec/javascripts/activities_spec.js.es6
+1
-1
No files found.
app/assets/javascripts/activities.js.es6
View file @
ed88515d
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-undef, quotes, no-var, padded-blocks, max-len */
(function() {
this.Activities = (function() {
function Activities() {
/* eslint-disable no-param-reassign, class-methods-use-this */
/* global Pager, Cookies */
((global) => {
class Activities {
constructor() {
Pager.init(20, true, false, this.updateTooltips);
$(".event-filter-link").on("click", (function(_this) {
return function(event) {
$('.event-filter-link').on('click', (event) => {
event.preventDefault();
_this.toggleFilter($(event.currentTarget));
return _this.reloadActivities();
};
})(this));
this.toggleFilter($(event.currentTarget));
this.reloadActivities();
});
}
Activities.prototype.updateTooltips = function
() {
updateTooltips
() {
gl.utils.localTimeAgo($('.js-timeago', '.content_list'));
}
;
}
Activities.prototype.reloadActivities = function
() {
$(
".content_list"
).html('');
reloadActivities
() {
$(
'.content_list'
).html('');
Pager.init(20, true, false, this.updateTooltips);
};
Activities.prototype.toggleFilter = function(sender) {
var filter = sender.attr("id").split("_")[0];
$('.event-filter .active').removeClass("active");
Cookies.set("event_filter", filter);
}
sender.closest('li').toggleClass("active");
}
;
toggleFilter(sender) {
const filter = sender.attr('id').split('_')[0]
;
return Activities;
$('.event-filter .active').removeClass('active');
Cookies.set('event_filter', filter);
})();
sender.closest('li').toggleClass('active');
}
}
}).call(this);
global.Activities = Activities;
})(window.gl || (window.gl = {}));
app/assets/javascripts/dispatcher.js.es6
View file @
ed88515d
...
...
@@ -110,10 +110,10 @@
Issuable.init();
break;
case 'dashboard:activity':
new Activities();
new
gl.
Activities();
break;
case 'dashboard:projects:starred':
new Activities();
new
gl.
Activities();
break;
case 'projects:commit:show':
new Commit();
...
...
@@ -139,7 +139,7 @@
new gl.Pipelines();
break;
case 'groups:activity':
new Activities();
new
gl.
Activities();
break;
case 'groups:show':
shortcut_handler = new ShortcutsNavigation();
...
...
app/assets/javascripts/user_tabs.js.es6
View file @
ed88515d
...
...
@@ -134,7 +134,7 @@ content on the Users#show page.
}
const $calendarWrap = this.$parentEl.find('.user-calendar');
$calendarWrap.load($calendarWrap.data('href'));
new Activities();
new
gl.
Activities();
return this.loaded['activity'] = true;
}
...
...
app/views/projects/_activity.html.haml
View file @
ed88515d
...
...
@@ -13,7 +13,7 @@
=
spinner
:javascript
var
activity
=
new
Activities
();
var
activity
=
new
gl
.
Activities
();
$
(
document
).
on
(
'
page:restore
'
,
function
(
event
)
{
activity
.
reloadActivities
()
})
spec/javascripts/activities_spec.js.es6
View file @
ed88515d
...
...
@@ -35,7 +35,7 @@
describe('Activities', () => {
beforeEach(() => {
fixture.load(fixtureTemplate);
new Activities();
new
gl.
Activities();
});
for(let i = 0; i < filters.length; i++) {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment