diff --git a/assets/scripts/app/templates/repos/show/tools.hbs b/assets/scripts/app/templates/repos/show/tools.hbs index 0aac8ddb..e4057b14 100644 --- a/assets/scripts/app/templates/repos/show/tools.hbs +++ b/assets/scripts/app/templates/repos/show/tools.hbs @@ -37,14 +37,14 @@

{{#if view.branches.isLoaded}} - {{view Ember.Select contentBinding="view.branches" selectionBinding="view.branch" optionLabelPath="content.commit.branch" optionValuePath="content.commit.branch"}} + {{view Ember.Select contentBinding="view.branches" selectionBinding="view.statusImageBranch" optionLabelPath="content.commit.branch" optionValuePath="content.commit.branch"}} {{else}} {{/if}}

- +

diff --git a/assets/scripts/app/views/repo/show.coffee b/assets/scripts/app/views/repo/show.coffee index 4d9e5e41..d536a4d7 100644 --- a/assets/scripts/app/views/repo/show.coffee +++ b/assets/scripts/app/views/repo/show.coffee @@ -173,26 +173,33 @@ @get('repo.branches') if @get('active') ).property('active', 'repo.branches') + setStatusImageBranch: (-> + if @get('repo.branches.isLoaded') + @set('statusImageBranch', @get('repo.branches').findProperty('commit.branch', @get('build.commit.branch'))) + else + @set('statusImageBranch', null) + ).observes('repo.branches', 'repo.branches.isLoaded', 'build.commit.branch') + urlRepo: (-> 'https://' + location.host + Travis.Urls.repo(@get('repo.slug')) ).property('repo.slug') - urlStatusImage: (-> - Travis.Urls.statusImage(@get('repo.slug'), @get('branch.commit.branch')) - ).property('repo.slug', 'branch') + statusImageUrl: (-> + Travis.Urls.statusImage(@get('repo.slug'), @get('statusImageBranch.commit.branch')) + ).property('repo.slug', 'statusImageBranch') markdownStatusImage: (-> - "[![Build Status](#{@get('urlStatusImage')})](#{@get('urlRepo')})" - ).property('urlStatusImage') + "[![Build Status](#{@get('statusImageUrl')})](#{@get('urlRepo')})" + ).property('statusImageUrl') textileStatusImage: (-> - "!#{@get('urlStatusImage')}!:#{@get('urlRepo')}" - ).property('urlStatusImage') + "!#{@get('statusImageUrl')}!:#{@get('urlRepo')}" + ).property('statusImageUrl') rdocStatusImage: (-> - "{\"Build}[#{@get('urlRepo')}]" - ).property('urlStatusImage') + "{\"Build}[#{@get('urlRepo')}]" + ).property('statusImageUrl') asciidocStatusImage: (-> - "image:#{@get('urlStatusImage')}[\"Build Status\", link=\"#{@get('urlRepo')}\"]" - ).property('urlStatusImage') + "image:#{@get('statusImageUrl')}[\"Build Status\", link=\"#{@get('urlRepo')}\"]" + ).property('statusImageUrl')