Skip to content

Commit 8bc822c

Browse files
committed
Fix Safari endless reloading
Related to #185
1 parent d1a6be1 commit 8bc822c

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

assets/components/collections/js/mgr/widgets/category/collections.grid.resources.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ Collections.grid.ContainerCollections = function(config) {
4141
Collections.grid.ContainerCollections.superclass.constructor.call(this,config);
4242
this.on('rowclick',MODx.fireResourceFormChange);
4343
this.on('click', this.handleButtons, this);
44+
45+
window.history.replaceState({}, '', window.location.href);
4446

4547
this.initBreadCrumbs(config);
4648

@@ -844,11 +846,12 @@ Ext.extend(Collections.grid.ContainerCollections,MODx.grid.Grid,{
844846
this.addEvents('breadCrumbsBeforeRender');
845847
this.addEvents('breadCrumbsRender');
846848

847-
// Commented out until I'll find fix for Safari
848-
//window.onpopstate = function(event) {
849-
// location.reload();
850-
//};
851-
849+
window.addEventListener('popstate', function(event) {
850+
if (event.state) {
851+
location.reload();
852+
}
853+
}, false);
854+
852855
this.on('breadCrumbsRender', function(toolbar){
853856
var folder = parseInt(MODx.request.folder);
854857
var collection = parseInt(MODx.request.id);

core/components/collections/docs/changelog.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Changelog for Collections.
22

3+
- Fix Safari endless reloading
34
- Fix Selections when sorting by menuindex
4-
- Hotfix for endless loading in Safari
55

66
Collections 3.4.0
77
===================

0 commit comments

Comments
 (0)