refactoring

This commit is contained in:
rolux 2014-02-14 16:49:42 +00:00
parent 9aa03a111b
commit 37c9fcb192

View file

@ -8,16 +8,13 @@ pandora.ui.embedPanel = function() {
ui = pandora.user.ui,
view = !ui.item ? ui.listView : ui.itemView;
if (ui.section != 'texts' && !ui.page) {
if (ui.section == 'edits') {
that = pandora.ui.editPanel(true);
} else if (!ui.item) {
if (!ui.page) {
if (ui.section == 'items') {
if (!ui.item) {
if (view == 'grid') {
that = pandora.ui.embedGrid();
} else if (view == 'clip') {
that = pandora.ui.embedError(true);
} else if (view == 'video') {
that = pandora.ui.videoView(true);
} else if (Ox.contains(['map', 'calendar'], view)) {
that = pandora.ui.embedNavigation(view);
}
@ -34,6 +31,14 @@ pandora.ui.embedPanel = function() {
that = pandora.ui.embedNavigation(view);
}
}
} else if (ui.section == 'edits') {
// FIXME: this is non-standard, see above!
that = pandora.ui.editPanel(true);
} else {
that = pandora.ui.embedError(true)
}
} else if (ui.page == 'documents' && ui.document) {
that = pandora.ui.embedError(true);
}
if (!that) {
that = pandora.ui.embedError();