don't reload groups when changing list view or list sort
This commit is contained in:
parent
5053fc5c4c
commit
929cf988a1
6 changed files with 41 additions and 17 deletions
|
|
@ -78,7 +78,6 @@ pandora.URL = (function() {
|
|||
url = '/' + url;
|
||||
}
|
||||
history.pushState({}, pandora.site.site.name + (title ? ' - ' + title : ''), url);
|
||||
oldUserUI = Ox.clone(pandora.user.ui);
|
||||
this.update();
|
||||
},
|
||||
|
||||
|
|
@ -97,18 +96,39 @@ pandora.URL = (function() {
|
|||
});
|
||||
},
|
||||
|
||||
push: function(title, url) {
|
||||
if (arguments.length == 1) { // fixme: remove later
|
||||
url = title;
|
||||
}
|
||||
if (url[0] != '/') {
|
||||
url = '/' + url;
|
||||
}
|
||||
history.pushState({}, pandora.site.site.name + (title ? ' - ' + title : ''), url);
|
||||
},
|
||||
|
||||
update: function() {
|
||||
var oldUserUI = Ox.clone(pandora.user.ui);
|
||||
this.parse();
|
||||
if (pandora.user.ui.section != oldUserUI.section) {
|
||||
pandora.$ui.appPanel.replaceElement(1, pandora.$ui.mainPanel = pandora.ui.mainPanel());
|
||||
} else if (pandora.user.ui.sitePage != oldUserUI.sitePage) {
|
||||
pandora.$ui.mainPanel.replaceElement(1, pandora.$ui.rightPanel = pandora.ui.rightPanel());
|
||||
} else if (!pandora.user.ui.item && !oldUserUI.item) {
|
||||
// list to list
|
||||
// fixme: isEqual doesn't work here
|
||||
if (Ox.isEqual(pandora.user.ui.findQuery, oldUserUI.findQuery) && false) {
|
||||
Ox.print('EQUAL', pandora.user.ui.findQuery, oldUserUI.findQuery)
|
||||
pandora.$ui.contentPanel.replaceElement(1, pandora.ui.list());
|
||||
} else {
|
||||
pandora.$ui.leftPanel.replaceElement(2, pandora.$ui.info = pandora.ui.info());
|
||||
pandora.$ui.mainPanel.replaceElement(1, pandora.$ui.rightPanel = pandora.ui.rightPanel());
|
||||
}
|
||||
} else if (!pandora.user.ui.item || !oldUserUI.item) {
|
||||
// list to list, list to item, item to list
|
||||
// list to item or item to list
|
||||
pandora.$ui.leftPanel.replaceElement(2, pandora.$ui.info = pandora.ui.info());
|
||||
pandora.$ui.mainPanel.replaceElement(1, pandora.$ui.rightPanel = pandora.ui.rightPanel());
|
||||
} else {
|
||||
// item to items
|
||||
// item to item
|
||||
pandora.$ui.leftPanel.replaceElement(2, pandora.$ui.info = pandora.ui.info());
|
||||
pandora.$ui.contentPanel.replaceElement(1, pandora.ui.item());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue