diff --git a/src/pfwbged/collection/pfwbcollection.js b/src/pfwbged/collection/pfwbcollection.js index cc7a0c9..a7c0836 100644 --- a/src/pfwbged/collection/pfwbcollection.js +++ b/src/pfwbged/collection/pfwbcollection.js @@ -445,6 +445,9 @@ function select_metatype(elem) /* install callbacks */ $('.metatypes input').change(function() { + var state = history.state || {}; + state.metatype = $(this).attr("value"); + history.replaceState(state, document.title); select_metatype($(this)); update_portaltypes(); return false; @@ -530,4 +533,13 @@ function select_metatype(elem) $('div.close', window.parent.document).click(); }); + var history_state = history.state; + if (history_state !== null) { + if (history_state.metatype !== undefined) { + var metatype = $('.metatypes [value="' + history_state.metatype + '"]'); + metatype.prop('checked', true); + metatype.trigger('change'); + } + } + }(jQuery));