Revert "popstate now in aspect-filters. back button now actually works on aspect/index."
This reverts commit 326155af54.
This commit is contained in:
parent
d1c3326867
commit
b22b13d73f
3 changed files with 11 additions and 44 deletions
|
|
@ -2,28 +2,6 @@ $('#aspect_stream_container').html("<%= escape_javascript(render('aspects/aspect
|
|||
$('#aspect_listings').html("<%= escape_javascript(render('aspects/aspect_listings', :aspects => @aspects)) %>");
|
||||
$('a[rel*=facebox]').facebox();
|
||||
|
||||
|
||||
var aspectIds = <%= @aspect_ids.to_json %>,
|
||||
selectors = $("li", "#aspect_nav");
|
||||
|
||||
if( selectors.length-2 != aspectIds.length ) {
|
||||
$.each( selectors, function(){
|
||||
var element = $(this);
|
||||
|
||||
if( $.inArray( parseInt(element.attr('data-guid')), aspectIds) != -1 ){
|
||||
element.addClass('selected');
|
||||
} else {
|
||||
element.removeClass('selected');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$.each( selectors, function(){
|
||||
$(this).removeClass('selected');
|
||||
});
|
||||
|
||||
selectors.first().addClass('selected');
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#main_stream').infinitescroll({
|
||||
navSelector : "#main_stream + div.pagination",
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@ Feature: saved state
|
|||
And I go to the aspects page
|
||||
|
||||
When I follow "Open 1"
|
||||
And I wait for the ajax to finish
|
||||
And I follow "Open 2"
|
||||
And I wait for the ajax to finish
|
||||
Then aspect "Open 1" should be selected
|
||||
And aspect "Open 2" should be selected
|
||||
But aspect "Closed 1" should not be selected
|
||||
|
|
|
|||
|
|
@ -17,11 +17,6 @@ $(document).ready(function(){
|
|||
}
|
||||
});
|
||||
|
||||
// popstate
|
||||
$(window).bind("popstate", function(){
|
||||
$.getScript(location.href);
|
||||
return false;
|
||||
});
|
||||
|
||||
$("a.hard_aspect_link").live("click", function(e){
|
||||
var link = $(this);
|
||||
|
|
@ -93,23 +88,19 @@ $(document).ready(function(){
|
|||
function generateURL(){
|
||||
var baseURL = location.href.split("?")[0];
|
||||
|
||||
if(selectedGUIDS.length != $('li', '#aspect_nav').length-2) {
|
||||
// generate new url
|
||||
baseURL = baseURL.replace('#','');
|
||||
baseURL += '?';
|
||||
for(i=0; i < selectedGUIDS.length; i++){
|
||||
baseURL += 'a_ids[]='+ selectedGUIDS[i] +'&';
|
||||
}
|
||||
// generate new url
|
||||
baseURL = baseURL.replace('#','');
|
||||
baseURL += '?';
|
||||
for(i=0; i < selectedGUIDS.length; i++){
|
||||
baseURL += 'a_ids[]='+ selectedGUIDS[i] +'&';
|
||||
}
|
||||
|
||||
if(!$("#publisher").hasClass("closed")) {
|
||||
// open publisher
|
||||
baseURL += "op=true";
|
||||
} else {
|
||||
// slice last '&'
|
||||
baseURL = baseURL.slice(0,baseURL.length-1);
|
||||
}
|
||||
if(!$("#publisher").hasClass("closed")) {
|
||||
// open publisher
|
||||
baseURL += "op=true";
|
||||
} else {
|
||||
selectedGUIDS = [];
|
||||
// slice last '&'
|
||||
baseURL = baseURL.slice(0,baseURL.length-1);
|
||||
}
|
||||
return baseURL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue