Prepare UI for notification settings
This commit is contained in:
parent
d55ade1686
commit
ba59912072
8 changed files with 81 additions and 20 deletions
|
@ -3,3 +3,11 @@ $ ->
|
|||
container = $(@).closest(".js-toggler-container")
|
||||
|
||||
container.toggleClass("on")
|
||||
|
||||
$("body").on "click", ".js-toggle-visibility-link", (e) ->
|
||||
$(@).find('i').
|
||||
toggleClass('icon-chevron-down').
|
||||
toggleClass('icon-chevron-up')
|
||||
container = $(".js-toggle-visibility-container")
|
||||
container.toggleClass("hide")
|
||||
e.preventDefault()
|
||||
|
|
9
app/assets/javascripts/extensions/jquery.js.coffee
Normal file
9
app/assets/javascripts/extensions/jquery.js.coffee
Normal file
|
@ -0,0 +1,9 @@
|
|||
$.fn.showAndHide = ->
|
||||
$(@).show().
|
||||
delay(3000).
|
||||
fadeOut()
|
||||
|
||||
$.fn.enableButton = ->
|
||||
$(@).removeAttr('disabled').
|
||||
removeClass('disabled')
|
||||
|
|
@ -7,6 +7,8 @@ window.slugify = (text) ->
|
|||
window.ajaxGet = (url) ->
|
||||
$.ajax({type: "GET", url: url, dataType: "script"})
|
||||
|
||||
window.showAndHide = (selector) ->
|
||||
|
||||
window.errorMessage = (message) ->
|
||||
ehtml = $("<p>")
|
||||
ehtml.addClass("error_message")
|
||||
|
|
|
@ -15,6 +15,8 @@ $ ->
|
|||
$(this).find('.update-failed').hide()
|
||||
|
||||
$('.update-username form').on 'ajax:complete', ->
|
||||
$(this).find('.save-btn').removeAttr('disabled')
|
||||
$(this).find('.save-btn').removeClass('disabled')
|
||||
$(this).find('.btn-save').enableButton()
|
||||
$(this).find('.loading-gif').hide()
|
||||
|
||||
$('.update-notifications').on 'ajax:complete', ->
|
||||
$(this).find('.btn-save').enableButton()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue