diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2016-01-21 16:27:05 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2016-01-21 16:27:05 +0000 |
commit | 347803058135841c3f0d0602f665d78d7b8a950b (patch) | |
tree | d34260fb9b6406e6a15dd5ec1719a00c294e359f /app | |
parent | 7b78c52b07fe4359a9f2a411ff5fc355eddeab34 (diff) | |
parent | 66b0927bb5e19f8a4a3df3e7e401ddd1e3d8e768 (diff) | |
download | gitlab-ce-347803058135841c3f0d0602f665d78d7b8a950b.tar.gz |
Merge branch 'fix/artifacts-download-progress-bar' into 'master'
Do not use progress bar when downloading build artifacts
Closes #12491
See merge request !2531
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/build_artifacts.js.coffee | 14 | ||||
-rw-r--r-- | app/assets/javascripts/dispatcher.js.coffee | 2 | ||||
-rw-r--r-- | app/views/projects/artifacts/browse.html.haml | 11 |
3 files changed, 17 insertions, 10 deletions
diff --git a/app/assets/javascripts/build_artifacts.js.coffee b/app/assets/javascripts/build_artifacts.js.coffee new file mode 100644 index 00000000000..5ae6cba56c8 --- /dev/null +++ b/app/assets/javascripts/build_artifacts.js.coffee @@ -0,0 +1,14 @@ +class @BuildArtifacts + constructor: () -> + @disablePropagation() + @setupEntryClick() + + disablePropagation: -> + $('.top-block').on 'click', '.download', (e) -> + e.stopPropagation() + $('.tree-holder').on 'click', 'tr[data-link] a', (e) -> + e.stopImmediatePropagation() + + setupEntryClick: -> + $('.tree-holder').on 'click', 'tr[data-link]', (e) -> + window.location = @dataset.link diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee index 0d88e8d254a..2cdf01d874c 100644 --- a/app/assets/javascripts/dispatcher.js.coffee +++ b/app/assets/javascripts/dispatcher.js.coffee @@ -100,6 +100,8 @@ class Dispatcher shortcut_handler = true when 'projects:forks:new' new ProjectFork() + when 'projects:artifacts:browse' + new BuildArtifacts() when 'users:show' new User() new Activities() diff --git a/app/views/projects/artifacts/browse.html.haml b/app/views/projects/artifacts/browse.html.haml index d3c969cc035..84034c8bf16 100644 --- a/app/views/projects/artifacts/browse.html.haml +++ b/app/views/projects/artifacts/browse.html.haml @@ -4,7 +4,7 @@ .top-block.gray-content-block.clearfix .pull-right = link_to download_namespace_project_build_artifacts_path(@project.namespace, @project, @build), - class: 'btn btn-default' do + class: 'btn btn-default download' do = icon('download') Download artifacts archive @@ -20,12 +20,3 @@ - if @entry.empty? .center Empty - -:javascript - $('.tree-holder').on('click', 'tr[data-link] a', function(e) { - e.stopImmediatePropagation(); - }); - - $('.tree-holder').on('click', 'tr[data-link]', function(e) { - window.location = this.dataset.link; - }); |