mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-28 13:31:06 +00:00
Cleanup: move out js, require_self shouldnt be necessary
This commit is contained in:
parent
8187b1c5bc
commit
b06d39a86e
1 changed files with 2 additions and 40 deletions
|
@ -6,43 +6,5 @@
|
||||||
//= require tinymce-jquery
|
//= require tinymce-jquery
|
||||||
//= require yetii
|
//= require yetii
|
||||||
//= require local
|
//= require local
|
||||||
//= require_self
|
//= require shoutbox
|
||||||
|
//= require misc
|
||||||
$ ->
|
|
||||||
$('#logout').click ->
|
|
||||||
$(this).closest('form').submit()
|
|
||||||
|
|
||||||
$('select').each (i, el) ->
|
|
||||||
$select = $(el)
|
|
||||||
|
|
||||||
$select.wrap '<div class="select-wrapper" />'
|
|
||||||
$select.on 'DOMSubtreeModified', (event) ->
|
|
||||||
$el = $(this)
|
|
||||||
$wrapper = $el.parent()
|
|
||||||
|
|
||||||
if $el.is("[disabled]")
|
|
||||||
$wrapper.addClass 'disabled'
|
|
||||||
else
|
|
||||||
$wrapper.removeClass 'disabled'
|
|
||||||
|
|
||||||
$select.trigger 'DOMSubtreeModified'
|
|
||||||
|
|
||||||
$('a[href=#form_submit]').click ->
|
|
||||||
$(this).closest('form').submit()
|
|
||||||
return false
|
|
||||||
|
|
||||||
$('select.autosubmit').change ->
|
|
||||||
$(this).closest('form').submit()
|
|
||||||
|
|
||||||
$('#notification').delay(3000).fadeOut()
|
|
||||||
|
|
||||||
$('#steam-search a').click (event) ->
|
|
||||||
event.preventDefault()
|
|
||||||
|
|
||||||
$search = $('#steam-search')
|
|
||||||
id = $search.data 'user-id'
|
|
||||||
|
|
||||||
$search.html "<p>Searching...</p>"
|
|
||||||
|
|
||||||
$.get "/api/v1/users/#{id}", (data) ->
|
|
||||||
$search.html "<a href='#{data.steam.url}'>Steam Profile: #{data.steam.nickname}</a>"
|
|
Loading…
Reference in a new issue