summaryrefslogtreecommitdiff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/application.js.coffee6
-rw-r--r--app/assets/javascripts/dispatcher.js.coffee5
-rw-r--r--app/assets/javascripts/projects_list.js.coffee2
-rw-r--r--app/assets/javascripts/syntax_highlight.coffee9
-rw-r--r--app/assets/javascripts/users_select.js.coffee2
5 files changed, 19 insertions, 5 deletions
diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee
index bb0a0c51fd4..c263912b7ea 100644
--- a/app/assets/javascripts/application.js.coffee
+++ b/app/assets/javascripts/application.js.coffee
@@ -116,6 +116,12 @@ $ ->
$('.remove-row').bind 'ajax:success', ->
$(this).closest('li').fadeOut()
+ $('.js-remove-tr').bind 'ajax:before', ->
+ $(this).hide()
+
+ $('.js-remove-tr').bind 'ajax:success', ->
+ $(this).closest('tr').fadeOut()
+
# Initialize select2 selects
$('select.select2').select2(width: 'resolve', dropdownAutoWidth: true)
diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee
index 81e73799271..5bf0b302179 100644
--- a/app/assets/javascripts/dispatcher.js.coffee
+++ b/app/assets/javascripts/dispatcher.js.coffee
@@ -51,10 +51,10 @@ class Dispatcher
MergeRequests.init()
when 'dashboard:show', 'root:show'
new Dashboard()
+ when 'dashboard:activity'
new Activities()
when 'dashboard:projects:starred'
new Activities()
- new ProjectsList()
when 'projects:commit:show'
new Commit()
new Diff()
@@ -69,7 +69,6 @@ class Dispatcher
when 'groups:show'
new Activities()
shortcut_handler = new ShortcutsNavigation()
- new ProjectsList()
when 'groups:group_members:index'
new GroupMembers()
new UsersSelect()
@@ -95,8 +94,6 @@ class Dispatcher
when 'users:show'
new User()
new Activities()
- when 'admin:users:show'
- new ProjectsList()
switch path.first()
when 'admin'
diff --git a/app/assets/javascripts/projects_list.js.coffee b/app/assets/javascripts/projects_list.js.coffee
index c0e36d1ccc5..db5faf71faf 100644
--- a/app/assets/javascripts/projects_list.js.coffee
+++ b/app/assets/javascripts/projects_list.js.coffee
@@ -8,7 +8,7 @@ class @ProjectsList
$(".projects-list-filter").keyup ->
terms = $(this).val()
- uiBox = $(this).closest('.panel')
+ uiBox = $(this).closest('.projects-list-holder')
if terms == "" || terms == undefined
uiBox.find(".projects-list li").show()
else
diff --git a/app/assets/javascripts/syntax_highlight.coffee b/app/assets/javascripts/syntax_highlight.coffee
new file mode 100644
index 00000000000..510f15d1b49
--- /dev/null
+++ b/app/assets/javascripts/syntax_highlight.coffee
@@ -0,0 +1,9 @@
+# Applies a syntax highlighting color scheme CSS class to any element with the
+# `js-syntax-highlight` class
+#
+# ### Example Markup
+#
+# <div class="js-syntax-highlight"></div>
+#
+$(document).on 'ready page:load', ->
+ $('.js-syntax-highlight').addClass(gon.user_color_scheme)
diff --git a/app/assets/javascripts/users_select.js.coffee b/app/assets/javascripts/users_select.js.coffee
index aeeed9ca3cc..9157562a5c5 100644
--- a/app/assets/javascripts/users_select.js.coffee
+++ b/app/assets/javascripts/users_select.js.coffee
@@ -6,6 +6,7 @@ class @UsersSelect
$('.ajax-users-select').each (i, select) =>
@projectId = $(select).data('project-id')
@groupId = $(select).data('group-id')
+ @showCurrentUser = $(select).data('current-user')
showNullUser = $(select).data('null-user')
showAnyUser = $(select).data('any-user')
showEmailUser = $(select).data('email-user')
@@ -108,6 +109,7 @@ class @UsersSelect
active: true
project_id: @projectId
group_id: @groupId
+ current_user: @showCurrentUser
dataType: "json"
).done (users) ->
callback(users)