Fix race condition #32781
This commit is contained in:
parent
5693bcb77d
commit
6b84fcd84d
|
@ -533,13 +533,23 @@ 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');
|
||||
/* search restoration starts here */
|
||||
|
||||
var restore_ppfwbged_search = function() {
|
||||
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).trigger('change');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var waitForQuerywidget = setInterval(function () {
|
||||
if ($.querywidget.initialized_over === true) {
|
||||
restore_ppfwbged_search();
|
||||
clearInterval(waitForQuerywidget);
|
||||
}
|
||||
}, 500);
|
||||
|
||||
}(jQuery));
|
||||
|
|
Reference in New Issue