Commit 93e8a056 authored by Ciro Santilli's avatar Ciro Santilli

Only run profile js on pages that need it

parent 72abe9f6
...@@ -79,11 +79,15 @@ class Dispatcher ...@@ -79,11 +79,15 @@ class Dispatcher
# Ensure we don't create a particular shortcut handler here. This is # Ensure we don't create a particular shortcut handler here. This is
# already created, where the network graph is created. # already created, where the network graph is created.
shortcut_handler = true shortcut_handler = true
when 'users:show'
new User()
switch path.first() switch path.first()
when 'admin' then new Admin() when 'admin' then new Admin()
when 'dashboard' when 'dashboard'
shortcut_handler = new ShortcutsDashboardNavigation() shortcut_handler = new ShortcutsDashboardNavigation()
when 'profiles'
new Profile()
when 'projects' when 'projects'
switch path[1] switch path[1]
when 'wikis' when 'wikis'
......
$ -> class @Profile
constructor: ->
$('.edit_user .application-theme input, .edit_user .code-preview-theme input').click -> $('.edit_user .application-theme input, .edit_user .code-preview-theme input').click ->
# Submit the form # Submit the form
$('.edit_user').submit() $('.edit_user').submit()
...@@ -26,5 +27,3 @@ $ -> ...@@ -26,5 +27,3 @@ $ ->
form = $(this).closest("form") form = $(this).closest("form")
filename = $(this).val().replace(/^.*[\\\/]/, '') filename = $(this).val().replace(/^.*[\\\/]/, '')
form.find(".js-avatar-filename").text(filename) form.find(".js-avatar-filename").text(filename)
$('.profile-groups-avatars').tooltip("placement": "top")
class @User
constructor: ->
$('.profile-groups-avatars').tooltip("placement": "top")
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