Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/project_new.js')
-rw-r--r--app/assets/javascripts/project_new.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/app/assets/javascripts/project_new.js b/app/assets/javascripts/project_new.js
new file mode 100644
index 00000000000..9a98607a8f7
--- /dev/null
+++ b/app/assets/javascripts/project_new.js
@@ -0,0 +1,41 @@
+// Generated by CoffeeScript 1.10.0
+(function() {
+ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
+
+ this.ProjectNew = (function() {
+ function ProjectNew() {
+ this.toggleSettings = bind(this.toggleSettings, this);
+ $('.project-edit-container').on('ajax:before', (function(_this) {
+ return function() {
+ $('.project-edit-container').hide();
+ return $('.save-project-loader').show();
+ };
+ })(this));
+ this.toggleSettings();
+ this.toggleSettingsOnclick();
+ }
+
+ ProjectNew.prototype.toggleSettings = function() {
+ this._showOrHide('#project_builds_enabled', '.builds-feature');
+ return this._showOrHide('#project_merge_requests_enabled', '.merge-requests-feature');
+ };
+
+ ProjectNew.prototype.toggleSettingsOnclick = function() {
+ return $('#project_builds_enabled, #project_merge_requests_enabled').on('click', this.toggleSettings);
+ };
+
+ ProjectNew.prototype._showOrHide = function(checkElement, container) {
+ var $container;
+ $container = $(container);
+ if ($(checkElement).prop('checked')) {
+ return $container.show();
+ } else {
+ return $container.hide();
+ }
+ };
+
+ return ProjectNew;
+
+ })();
+
+}).call(this);