diff --git a/assets/scripts/app/templates/repos/show/tools.hbs b/assets/scripts/app/templates/repos/show/tools.hbs index cd1278ba..b36bdbdd 100644 --- a/assets/scripts/app/templates/repos/show/tools.hbs +++ b/assets/scripts/app/templates/repos/show/tools.hbs @@ -37,38 +37,6 @@ -
- - {{#if view.branches.isLoaded}} - {{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/templates/status_images.hbs b/assets/scripts/app/templates/status_images.hbs new file mode 100644 index 00000000..47cd3477 --- /dev/null +++ b/assets/scripts/app/templates/status_images.hbs @@ -0,0 +1,29 @@ + +
+ + {{#if view.branches.isLoaded}} + {{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.coffee b/assets/scripts/app/views.coffee index 39381515..9acf548b 100644 --- a/assets/scripts/app/views.coffee +++ b/assets/scripts/app/views.coffee @@ -9,6 +9,10 @@ require 'ext/ember/namespace' popupClose: (event) -> $(event.target).closest('.popup').removeClass('display') popupCloseAll: -> + if view = Travis.View.currentPopupView + view.destroy() + Travis.View.currentPopupView = null + $('.popup').removeClass('display') require 'views/accounts' @@ -23,3 +27,4 @@ require 'views/sidebar' require 'views/stats' require 'views/signin' require 'views/top' +require 'views/status_images' diff --git a/assets/scripts/app/views/repo/show.coffee b/assets/scripts/app/views/repo/show.coffee index bee580b7..f98016eb 100644 --- a/assets/scripts/app/views/repo/show.coffee +++ b/assets/scripts/app/views/repo/show.coffee @@ -105,7 +105,12 @@ statusImages: (event) -> @set('active', true) @closeMenu() - @popup(event) + @popupCloseAll() + view = Travis.StatusImagesView.create(toolsView: this) + # TODO: create a general mechanism for managing current popup + # and move all popups to use it + Travis.View.currentPopupView = view + view.appendTo($('body')) event.stopPropagation() regenerateKeyPopup: (event) -> @@ -181,38 +186,3 @@ if permissions = Travis.app.get('currentUser.permissions') permissions.contains @get('repo.id') ).property('Travis.app.currentUser.permissions.length', 'repo.id') - - urlRepo: (-> - "https://#{location.host}/#{@get('repo.slug')}" - ).property('repo.slug') - - branches: (-> - @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') - - statusImageUrl: (-> - Travis.Urls.statusImage(@get('repo.slug'), @get('statusImageBranch.commit.branch')) - ).property('repo.slug', 'statusImageBranch') - - markdownStatusImage: (-> - "[})](#{@get('urlRepo')})" - ).property('statusImageUrl') - - textileStatusImage: (-> - "!#{@get('statusImageUrl')}!:#{@get('urlRepo')}" - ).property('statusImageUrl') - - rdocStatusImage: (-> - "{