Commit c92d63e5 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Make js pieforms work after js pagination


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 034328b5
......@@ -68,6 +68,16 @@ var Paginator = function(id, datatable, script, extradata) {
else {
tbody.innerHTML = data['data']['tablerows'];
}
// Pieforms should probably separate its js from its html. For
// now, be evil: scrape it out of the script elements and eval
// it every time the page changes.
forEach(getElementsByTagAndClassName('script', null, tbody), function(s) {
var m = scrapeText(s).match(new RegExp('^(new Pieform\\\(.*?\\\);)$'));
if (m && m[1]) {
eval('var pf = ' + m[1] + ' pf.init();');
}
});
}
// Update the pagination
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment