forked from 0x2620/pandora
refactoring
This commit is contained in:
parent
9aa03a111b
commit
37c9fcb192
1 changed files with 29 additions and 24 deletions
|
@ -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();
|
||||
|
@ -49,7 +54,7 @@ pandora.ui.embedPanel = function() {
|
|||
return that;
|
||||
};
|
||||
|
||||
//only add reloadPanel if not defined by embed element
|
||||
// only add reloadPanel if not defined by embed element
|
||||
that.reloadPanel = that.reloadPanel || function(data) {
|
||||
if (Ox.isUndefined(data) || data.value != data.previousValue) {
|
||||
pandora.$ui.embedPanel.replaceWith(pandora.$ui.embedPanel = pandora.ui.embedPanel());
|
||||
|
|
Loading…
Reference in a new issue