
After recent refactorings status images popup started to fetch branches info whenever a repo page was opened, resulting in additional HTTP requests. Furthermore, because of a way we load branches, it could result in builds view displaying very old builds, because in API V2 we essentially download last build for each branch for branches request. This commit fixes the situation in 2 ways: 1. We wait with downloading branhes till the popup is open 2. We use a V3 requests to download branches and we don't put that data into the store
17 lines
415 B
JavaScript
17 lines
415 B
JavaScript
import Ember from 'ember';
|
|
|
|
export default Ember.Service.extend({
|
|
open(name) {
|
|
var ref;
|
|
this.close();
|
|
name = (typeof event !== "undefined" && event !== null ? (ref = event.target) != null ? ref.name : void 0 : void 0) || name;
|
|
this.set('popupName', name);
|
|
$("#" + name).toggleClass('display');
|
|
},
|
|
|
|
close() {
|
|
this.set('popupName', null);
|
|
$('.popup').removeClass('display');
|
|
}
|
|
});
|