@@ -195,59 +195,59 @@ var callbacks = function(State){
$(document).ready(function(){
ypjax_links();
var $files_data = $('#files_data');
//Bind to StateChange Event
History.Adapter.bind(window,'statechange',function(){
var State = History.getState();
cache_key = State.url;
//check if we have this request in cache maybe ?
var _cache_obj = CACHE[cache_key];
var _cur_time = new Date().getTime();
// get from cache if it's there and not yet expired !
if(_cache_obj !== undefined && _cache_obj[0] > _cur_time){
$files_data.html(_cache_obj[1]);
$files_data.css('opacity','1.0');
//callbacks after ypjax call
callbacks(State);
}
else{
asynchtml(State.url, $files_data, function(){
var expire_on = new Date().getTime() + CACHE_EXPIRE;
CACHE[cache_key] = [expire_on, $files_data.html()];
});
// init the search filter
var _State = {
url: "${h.url.current()}",
data: {
node_list_url: node_list_url.replace('__REV__',"${c.changeset.raw_id}").replace('__FPATH__', "${h.safe_unicode(c.file.path)}"),
url_base: url_base.replace('__REV__',"${c.changeset.raw_id}"),
rev:"${c.changeset.raw_id}",
f_path: "${h.safe_unicode(c.file.path)}"
fileBrowserListeners(_State.url, _State.data.node_list_url, _State.data.url_base);
// change branch filter
$("#branch_selector").select2({
dropdownAutoWidth: true,
minimumInputLength: 1
$("#branch_selector").change(function(e){
var selected = e.currentTarget.options[e.currentTarget.selectedIndex].value;
if(selected && selected != "${c.changeset.raw_id}"){
window.location = pyroutes.url('files_home', {'repo_name': "${h.safe_unicode(c.repo_name)}", 'revision': selected, 'f_path': "${h.safe_unicode(c.file.path)}"});
$("#browserblock").hide();
$("#body.browserblock").hide();
} else {
$("#branch_selector").val("${c.changeset.raw_id}");
</script>
</%def>
Status change: