Commit a792427e authored by Jacob Schatz's avatar Jacob Schatz

Merge branch 'add-js-prefix-to-user-tab-classes' into 'master'

Add JS prefix to user tab classes

## What does this MR do

This MR adds the `js-` prefix to the classes which are used for js purposes only. This MR only affects the said classes inside `users/show.html.haml`.

## Are there points in the code the reviewer needs to double check?

I'm not entirely sure if this project uses the `js-` prefix for
classes that are used for js purposes only. Doing a grep shows some of the classes have the prefix, but I'm still unsure whether this project follows this rule.

## Why was this MR needed?

As I was working thru #13401, I wanted to add a tab on the user profile page to show the contributions outside the GitLab instance. Reading the JS, I came across this. This MR helps new people reading the code that the said classes are for js purposes only. Also, it helps the project work toward to uniform class naming.

I suggest that we document adding the `js-` prefix to classes for js purposes only (if this is the case for this project)

See merge request !3928
parents 2ec58d4a 40b0afdd
...@@ -92,7 +92,7 @@ class @UserTabs ...@@ -92,7 +92,7 @@ class @UserTabs
@setCurrentAction(action) @setCurrentAction(action)
activateTab: (action) -> activateTab: (action) ->
@parentEl.find(".nav-links .#{action}-tab a").tab('show') @parentEl.find(".nav-links .js-#{action}-tab a").tab('show')
setTab: (source, action) -> setTab: (source, action) ->
return if @loaded[action] is true return if @loaded[action] is true
......
...@@ -69,13 +69,13 @@ ...@@ -69,13 +69,13 @@
= @user.location = @user.location
%ul.nav-links.center.user-profile-nav %ul.nav-links.center.user-profile-nav
%li.activity-tab %li.js-activity-tab
= link_to user_calendar_activities_path, data: {target: 'div#activity', action: 'activity', toggle: 'tab'} do = link_to user_calendar_activities_path, data: {target: 'div#activity', action: 'activity', toggle: 'tab'} do
Activity Activity
%li.groups-tab %li.js-groups-tab
= link_to user_groups_path, data: {target: 'div#groups', action: 'groups', toggle: 'tab'} do = link_to user_groups_path, data: {target: 'div#groups', action: 'groups', toggle: 'tab'} do
Groups Groups
%li.contributed-tab %li.js-contributed-tab
= link_to user_contributed_projects_path, data: {target: 'div#contributed', action: 'contributed', toggle: 'tab'} do = link_to user_contributed_projects_path, data: {target: 'div#contributed', action: 'contributed', toggle: 'tab'} do
Contributed projects Contributed projects
%li.projects-tab %li.projects-tab
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment