forked from 0x2620/pandora
don't recreate dialogs all the time
This commit is contained in:
parent
5b22b768a9
commit
9beb75eab7
3 changed files with 25 additions and 15 deletions
|
@ -146,7 +146,9 @@ pandora.URL = (function() {
|
|||
) {
|
||||
pandora.$ui.siteDialog = pandora.ui.siteDialog(state.page).open();
|
||||
} else if (state.page == 'help') {
|
||||
pandora.$ui.helpDialog = pandora.ui.helpDialog().open();
|
||||
(pandora.$ui.helpDialog || (
|
||||
pandora.$ui.helpDialog = pandora.ui.helpDialog()
|
||||
)).open();
|
||||
} else if (['signup', 'signin'].indexOf(state.page) > -1) {
|
||||
if (pandora.user.level == 'guest') {
|
||||
pandora.$ui.accountDialog = pandora.ui.accountDialog(state.page).open();
|
||||
|
|
|
@ -304,7 +304,7 @@ pandora.ui.item = function() {
|
|||
}
|
||||
})
|
||||
);
|
||||
that.bindEvent('resize', function(data) {
|
||||
pandora.$ui.editor.bindEvent('resize', function(data) {
|
||||
//Ox.print('resize item', data)
|
||||
pandora.$ui.editor.options({
|
||||
height: data.size
|
||||
|
|
|
@ -135,7 +135,7 @@ pandora.ui.mainMenu = function() {
|
|||
{ id: 'tour', title: 'Manage Tour...', disabled: !isAdmin }*/
|
||||
] },
|
||||
{ id: 'helpMenu', title: 'Help', items: [
|
||||
{ id: 'help', title: pandora.site.site.name + ' Help', keyboard: 'control ?' }
|
||||
{ id: 'help', title: pandora.site.site.name + ' Help', keyboard: 'shift ?' }
|
||||
] }
|
||||
],
|
||||
pandora.site.capabilities.canSeeDebugMenu[pandora.user.level]
|
||||
|
@ -236,18 +236,26 @@ pandora.ui.mainMenu = function() {
|
|||
pandora.UI.set({showBrowser: !ui.showBrowser});
|
||||
} else if (data.id == 'showannotations') {
|
||||
pandora.UI.set({showAnnotations: !ui.showAnnotations});
|
||||
} else if (data.id == 'names') {
|
||||
pandora.$ui.namesDialog = pandora.ui.namesDialog().open();
|
||||
} else if (data.id == 'titles') {
|
||||
pandora.$ui.titlesDialog = pandora.ui.titlesDialog().open();
|
||||
(pandora.$ui.titlesDialog || (
|
||||
pandora.$ui.titlesDialog = pandora.ui.titlesDialog()
|
||||
)).open();
|
||||
} else if (data.id == 'names') {
|
||||
(pandora.$ui.namesDialog || (
|
||||
pandora.$ui.namesDialog = pandora.ui.namesDialog()
|
||||
)).open();
|
||||
} else if (data.id == 'places') {
|
||||
pandora.$ui.placesDialog = pandora.ui.placesDialog().open();
|
||||
(pandora.$ui.placesDialog || (
|
||||
pandora.$ui.placesDialog = pandora.ui.placesDialog()
|
||||
)).open();
|
||||
} else if (data.id == 'events') {
|
||||
pandora.$ui.eventsDialog = pandora.ui.eventsDialog().open();
|
||||
(pandora.$ui.eventsDialog || (
|
||||
pandora.$ui.eventsDialog = pandora.ui.eventsDialog()
|
||||
)).open();
|
||||
} else if (data.id == 'users') {
|
||||
pandora.$ui.eventsDialog = pandora.ui.usersDialog().open();
|
||||
} else if (data.id == 'lists') {
|
||||
pandora.$ui.eventsDialog = pandora.ui.listsDialog().open();
|
||||
(pandora.$ui.usersDialog || (
|
||||
pandora.$ui.usersDialog = pandora.ui.usersDialog())
|
||||
).open();
|
||||
} else if (data.id == 'resetgroups') {
|
||||
pandora.UI.set({
|
||||
groups: pandora.site.user.ui.groups
|
||||
|
@ -274,13 +282,10 @@ pandora.ui.mainMenu = function() {
|
|||
}
|
||||
},
|
||||
key_control_f: function() {
|
||||
if ($('.OxDialog').length == 0 && $('.OxScreen').length == 0) {
|
||||
if ($('.OxDialog:visible').length == 0 && $('.OxScreen').length == 0) {
|
||||
pandora.$ui.findInput.focusInput(true);
|
||||
}
|
||||
},
|
||||
key_control_slash: function() {
|
||||
pandora.URL.push('/help');
|
||||
},
|
||||
key_shift_a: function() {
|
||||
pandora.UI.set({showAnnotations: !ui.showAnnotations});
|
||||
},
|
||||
|
@ -296,6 +301,9 @@ pandora.ui.mainMenu = function() {
|
|||
key_shift_s: function() {
|
||||
pandora.UI.set({showSidebar: !ui.showSidebar});
|
||||
},
|
||||
key_shift_slash: function() {
|
||||
pandora.URL.push('/help');
|
||||
},
|
||||
pandora_find: function() {
|
||||
var action = ui._list
|
||||
&& pandora.getListData(ui._list).user == pandora.user.username
|
||||
|
|
Loading…
Reference in a new issue