Skip to content

Instantly share code, notes, and snippets.

@azrad
Created October 15, 2012 09:48
Show Gist options
  • Save azrad/3891744 to your computer and use it in GitHub Desktop.
Save azrad/3891744 to your computer and use it in GitHub Desktop.
Bootstrap update paging html for CakePHP
jQuery(function() {
current_page = $("div.pagination ul li.current").html();
$('div.pagination ul li.current').addClass('active').html("<span>"+current_page+"</span>");
var prev = $("li.prev");
var prev_txt = $("li.prev").text();
var new_prev = ($("li.prev").hasClass("disabled") == true) ? $("li.prev").html("<span>previous</span>") : prev.html();
var next = $("li.next");
var next_txt = $("li.next").text();
var new_next = ($("li.next").hasClass("disabled") == true) ? $("li.next").html("<span>next</span>") : next.html();
});
@azrad
Copy link
Author

azrad commented Oct 25, 2012

jQuery(function() {
current_page = $("div.pagination ul li.current").html();
$('div.pagination ul li.current').addClass('active').html(""+current_page+"");

var prev = $("li.prev");
var prev_txt = $("li.prev").text();
var new_prev = ($("li.prev").hasClass("disabled") == true) ? $("li.prev").html("previous") : prev.html();

var next = $("li.next");
var next_txt = $("li.next").text();
var new_next = ($("li.next").hasClass("disabled") == true) ? $("li.next").html("next") : next.html();
});

@azrad
Copy link
Author

azrad commented Oct 25, 2012

Forgot I'm on git, should just edit the file above... well this is a fix for HIERARCHY_REQUEST_ERR: DOM Exception 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment