Fixed album url. Closes #44
This commit is contained in:
parent
48ab2826aa
commit
7e0db9074e
|
@ -2,7 +2,7 @@ var Ajax = {
|
|||
loadArtistData: function(name) {
|
||||
$('#search-container input').attr('disabled', 'disabled').blur();
|
||||
$('#search-container img').show();
|
||||
name = name.replace(' ', '+');
|
||||
name = name.split(' ').join('+');
|
||||
Ajax.setArchor('/artist/'+ name +'/');
|
||||
$.get('/artist/'+ name +'/', function(data){
|
||||
if (typeof data.error != 'undefined') {
|
||||
|
@ -51,24 +51,20 @@ var Ajax = {
|
|||
},
|
||||
|
||||
setArchor: function(anchor) {
|
||||
window.location = '#'+ anchor;
|
||||
window.location.hash = '#'+ anchor;
|
||||
},
|
||||
|
||||
getAnchor: function() {
|
||||
var tmp = window.location.href.split('#');
|
||||
if (typeof tmp[1] !== 'undefined') {
|
||||
return tmp[1];
|
||||
}
|
||||
return '';
|
||||
return window.location.hash.substring(1);
|
||||
},
|
||||
|
||||
detectStartPage: function() {
|
||||
if (m = this.getAnchor().match(/\/artist\/(.+)\//)) {
|
||||
this.loadArtistData(m[1]);
|
||||
} else if (this.getAnchor() === '' || this.getAnchor().match(/\/search\//)) {
|
||||
this.loadSearchPage();
|
||||
detectPage: function() {
|
||||
if (m = Ajax.getAnchor().match(/\/artist\/(.+)\//)) {
|
||||
Ajax.loadArtistData(m[1]);
|
||||
} else if (Ajax.getAnchor() === '' || Ajax.getAnchor().match(/\/search\//)) {
|
||||
Ajax.loadSearchPage();
|
||||
} else {
|
||||
this.load404Page();
|
||||
Ajax.load404Page();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -88,4 +84,5 @@ $(function(){
|
|||
Ajax.loadArtistData($('#search_field').val());
|
||||
return false;
|
||||
});
|
||||
$(window).bind('hashchange', Ajax.detectPage);
|
||||
})
|
|
@ -10,7 +10,7 @@ var beathaven = {
|
|||
init: function () {
|
||||
this.drawInterface();
|
||||
this.adjustSizes();
|
||||
Ajax.detectStartPage();
|
||||
Ajax.detectPage();
|
||||
},
|
||||
|
||||
drawInterface: function() {
|
||||
|
|
Loading…
Reference in New Issue