%PDF- %PDF-
| Direktori : /data/old/home/stash/atlassian-stash/static/feature/repository/ |
| Current File : //data/old/home/stash/atlassian-stash/static/feature/repository/sticky-branches-min.js |
define("feature/repository/sticky-branches",["jquery","util/client-storage","util/events","util/navbuilder","util/text","exports"],function(D,B,K,A,E,C){var H;var I;var J;C.onReady=function(){var N=A.parse(location.href),O=A.currentRepo().browse().build(),P=A.currentRepo().commits().build(),M=N.path().indexOf(O)===0,Q=N.path()===P,T=M?N.getQueryParamValue("at"):Q?N.getQueryParamValue("until"):undefined,L=M||Q,S=B.buildKey("current-branch","repo"),R=B.getSessionItem(S);H=D("#repository-nav-files");I=D("#repository-nav-commits");J=D("#repository-nav-branches");if(T){T=decodeURIComponent(T);if(T!==R){B.setSessionItem(S,T)}G(T)}else{if(L){B.removeSessionItem(S)}else{if(R){G(R)}}}K.on("stash.layout.branch.revisionRefChanged",function(U){if(U){if(!U.getIsDefault()){var V=U.getId();G(V);B.setSessionItem(S,V)}else{F();B.removeSessionItem(S)}}});K.on("stash.*.*.revisionRefRemoved",function(V){var U=B.getSessionItem(S);if(U&&E.endsWith(V.id,U)){F();B.removeSessionItem(S)}})};function G(L){if(L){L=encodeURIComponent(L);H.attr("href",A.parse(H.attr("href")).replaceQueryParam("at",L));I.attr("href",A.parse(I.attr("href")).replaceQueryParam("until",L));J.attr("href",A.parse(J.attr("href")).replaceQueryParam("base",L))}else{F()}}function F(){H.attr("href",A.parse(H.attr("href")).deleteQueryParam("at"));I.attr("href",A.parse(I.attr("href")).deleteQueryParam("until"));J.attr("href",A.parse(J.attr("href")).deleteQueryParam("base"))}});