debian-mirror-gitlab/app/assets/javascripts/project_new.js.coffee

24 lines
682 B
CoffeeScript
Raw Normal View History

2015-04-26 12:48:37 +05:30
class @ProjectNew
constructor: ->
$('.project-edit-container').on 'ajax:before', =>
$('.project-edit-container').hide()
$('.save-project-loader').show()
2016-06-02 11:05:42 +05:30
@toggleSettings()
@toggleSettingsOnclick()
toggleSettings: =>
@_showOrHide('#project_builds_enabled', '.builds-feature')
@_showOrHide('#project_merge_requests_enabled', '.merge-requests-feature')
2016-06-02 11:05:42 +05:30
toggleSettingsOnclick: ->
$('#project_builds_enabled, #project_merge_requests_enabled').on 'click', @toggleSettings
_showOrHide: (checkElement, container) ->
$container = $(container)
if $(checkElement).prop('checked')
$container.show()
else
$container.hide()