diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 16:37:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 16:37:47 +0300 |
commit | aee0a117a889461ce8ced6fcf73207fe017f1d99 (patch) | |
tree | 891d9ef189227a8445d83f35c1b0fc99573f4380 /app/assets/javascripts/labels.js | |
parent | 8d46af3258650d305f53b819eabf7ab18d22f59e (diff) |
Add latest changes from gitlab-org/gitlab@14-6-stable-eev14.6.0-rc42
Diffstat (limited to 'app/assets/javascripts/labels.js')
-rw-r--r-- | app/assets/javascripts/labels.js | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/app/assets/javascripts/labels.js b/app/assets/javascripts/labels.js deleted file mode 100644 index cd8cf0d354c..00000000000 --- a/app/assets/javascripts/labels.js +++ /dev/null @@ -1,37 +0,0 @@ -import $ from 'jquery'; - -export default class Labels { - constructor() { - this.setSuggestedColor = this.setSuggestedColor.bind(this); - this.updateColorPreview = this.updateColorPreview.bind(this); - this.cleanBinding(); - this.addBinding(); - this.updateColorPreview(); - } - - addBinding() { - $(document).on('click', '.suggest-colors a', this.setSuggestedColor); - return $(document).on('input', 'input#label_color', this.updateColorPreview); - } - // eslint-disable-next-line class-methods-use-this - cleanBinding() { - $(document).off('click', '.suggest-colors a'); - return $(document).off('input', 'input#label_color'); - } - // eslint-disable-next-line class-methods-use-this - updateColorPreview() { - const previewColor = $('input#label_color').val(); - return $('div.label-color-preview').css('background-color', previewColor); - // Updates the preview color with the hex-color input - } - - // Updates the preview color with a click on a suggested color - setSuggestedColor(e) { - const color = $(e.currentTarget).data('color'); - $('input#label_color').val(color); - this.updateColorPreview(); - // Notify the form, that color has changed - $('.label-form').trigger('keyup'); - return e.preventDefault(); - } -} |