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()
|
|
|
|
|
|
|
|
|
2016-06-16 23:09:34 +05:30
|
|
|
toggleSettings: =>
|
|
|
|
@_showOrHide('#project_builds_enabled', '.builds-feature')
|
|
|
|
@_showOrHide('#project_merge_requests_enabled', '.merge-requests-feature')
|
2016-06-02 11:05:42 +05:30
|
|
|
|
|
|
|
toggleSettingsOnclick: ->
|
2016-06-16 23:09:34 +05:30
|
|
|
$('#project_builds_enabled, #project_merge_requests_enabled').on 'click', @toggleSettings
|
|
|
|
|
|
|
|
_showOrHide: (checkElement, container) ->
|
|
|
|
$container = $(container)
|
|
|
|
|
|
|
|
if $(checkElement).prop('checked')
|
|
|
|
$container.show()
|
|
|
|
else
|
|
|
|
$container.hide()
|