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
Jérome Perrin
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 */
/* eslint-disable no-param-reassign, class-methods-use-this */
(function() {
/* global Pager, Cookies */
this.Activities = (function() {
function Activities() {
((global) => {
class Activities {
constructor() {
Pager.init(20, true, false, this.updateTooltips);
Pager.init(20, true, false, this.updateTooltips);
$(".event-filter-link").on("click", (function(_this) {
$('.event-filter-link').on('click', (event) => {
return function(event) {
event.preventDefault();
event.preventDefault();
_this.toggleFilter($(event.currentTarget));
this.toggleFilter($(event.currentTarget));
return _this.reloadActivities();
this.reloadActivities();
};
});
})(this));
}
}
Activities.prototype.updateTooltips = function
() {
updateTooltips
() {
gl.utils.localTimeAgo($('.js-timeago', '.content_list'));
gl.utils.localTimeAgo($('.js-timeago', '.content_list'));
}
;
}
Activities.prototype.reloadActivities = function
() {
reloadActivities
() {
$(
".content_list"
).html('');
$(
'.content_list'
).html('');
Pager.init(20, true, false, this.updateTooltips);
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 @@
...
@@ -110,10 +110,10 @@
Issuable.init();
Issuable.init();
break;
break;
case 'dashboard:activity':
case 'dashboard:activity':
new Activities();
new
gl.
Activities();
break;
break;
case 'dashboard:projects:starred':
case 'dashboard:projects:starred':
new Activities();
new
gl.
Activities();
break;
break;
case 'projects:commit:show':
case 'projects:commit:show':
new Commit();
new Commit();
...
@@ -139,7 +139,7 @@
...
@@ -139,7 +139,7 @@
new gl.Pipelines();
new gl.Pipelines();
break;
break;
case 'groups:activity':
case 'groups:activity':
new Activities();
new
gl.
Activities();
break;
break;
case 'groups:show':
case 'groups:show':
shortcut_handler = new ShortcutsNavigation();
shortcut_handler = new ShortcutsNavigation();
...
...
app/assets/javascripts/user_tabs.js.es6
View file @
ed88515d
...
@@ -134,7 +134,7 @@ content on the Users#show page.
...
@@ -134,7 +134,7 @@ content on the Users#show page.
}
}
const $calendarWrap = this.$parentEl.find('.user-calendar');
const $calendarWrap = this.$parentEl.find('.user-calendar');
$calendarWrap.load($calendarWrap.data('href'));
$calendarWrap.load($calendarWrap.data('href'));
new Activities();
new
gl.
Activities();
return this.loaded['activity'] = true;
return this.loaded['activity'] = true;
}
}
...
...
app/views/projects/_activity.html.haml
View file @
ed88515d
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
=
spinner
=
spinner
:javascript
:javascript
var
activity
=
new
Activities
();
var
activity
=
new
gl
.
Activities
();
$
(
document
).
on
(
'
page:restore
'
,
function
(
event
)
{
$
(
document
).
on
(
'
page:restore
'
,
function
(
event
)
{
activity
.
reloadActivities
()
activity
.
reloadActivities
()
})
})
spec/javascripts/activities_spec.js.es6
View file @
ed88515d
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
describe('Activities', () => {
describe('Activities', () => {
beforeEach(() => {
beforeEach(() => {
fixture.load(fixtureTemplate);
fixture.load(fixtureTemplate);
new Activities();
new
gl.
Activities();
});
});
for(let i = 0; i < filters.length; i++) {
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