From 98ebfffbb2fd1db41a5cec032efdb99a47a15b63 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 9 Nov 2011 09:49:59 +0000 Subject: [PATCH] disable edits and texts sections --- static/js/pandora/URL.js | 8 +++++--- static/js/pandora/sectionButtons.js | 4 ++-- static/js/pandora/sectionSelect.js | 4 ++-- static/js/pandora/siteDialog.js | 10 ++++++++-- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/static/js/pandora/URL.js b/static/js/pandora/URL.js index fd063a02..092ccb8e 100644 --- a/static/js/pandora/URL.js +++ b/static/js/pandora/URL.js @@ -75,7 +75,11 @@ pandora.URL = (function() { Ox.getPositionById(pandora.site.sitePages, state.page) > -1 || state.page == 'software' ) { - pandora.$ui.siteDialog = pandora.ui.siteDialog(state.page).open(); + if (pandora.$ui.siteDialog) { + pandora.$ui.siteDialog.select(state.page); + } else { + pandora.$ui.siteDialog = pandora.ui.siteDialog(state.page).open(); + } } else if (state.page == 'help') { pandora.$ui.helpDialog = pandora.ui.helpDialog().open(); } else if (['signup', 'signin'].indexOf(state.page) > -1) { @@ -258,7 +262,6 @@ pandora.URL = (function() { views: views }); - ///* window.onhashchange = function() { Ox.Request.cancel(); that.parse(); @@ -285,7 +288,6 @@ pandora.URL = (function() { that.parse(); } }; - //*/ return that; diff --git a/static/js/pandora/sectionButtons.js b/static/js/pandora/sectionButtons.js index f97c2df6..7cf2f040 100644 --- a/static/js/pandora/sectionButtons.js +++ b/static/js/pandora/sectionButtons.js @@ -4,8 +4,8 @@ pandora.ui.sectionButtons = function() { var that = Ox.ButtonGroup({ buttons: [ {id: 'items', selected: pandora.user.ui.section == 'items', title: pandora.site.itemName.plural}, - {id: 'edits', selected: pandora.user.ui.section == 'edits', title: 'Edits'}, - {id: 'texts', selected: pandora.user.ui.section == 'texts', title: 'Texts'} + {id: 'edits', selected: pandora.user.ui.section == 'edits', title: 'Edits', disabled: true}, + {id: 'texts', selected: pandora.user.ui.section == 'texts', title: 'Texts', disabled: true} ], id: 'sectionButtons', selectable: true diff --git a/static/js/pandora/sectionSelect.js b/static/js/pandora/sectionSelect.js index 7ab0d060..81da14fe 100644 --- a/static/js/pandora/sectionSelect.js +++ b/static/js/pandora/sectionSelect.js @@ -6,8 +6,8 @@ pandora.ui.sectionSelect = function() { id: 'sectionSelect', items: [ {checked: pandora.user.ui.section == 'items', id: 'items', title: pandora.site.itemName.plural}, - {checked: pandora.user.ui.section == 'edits', id: 'edits', title: 'Edits'}, - {checked: pandora.user.ui.section == 'texts', id: 'texts', title: 'Texts'} + {checked: pandora.user.ui.section == 'edits', id: 'edits', title: 'Edits', disabled: true}, + {checked: pandora.user.ui.section == 'texts', id: 'texts', title: 'Texts', disabled: true} ] }).css({ float: 'left', diff --git a/static/js/pandora/siteDialog.js b/static/js/pandora/siteDialog.js index 951c3e3f..490780e9 100644 --- a/static/js/pandora/siteDialog.js +++ b/static/js/pandora/siteDialog.js @@ -8,8 +8,9 @@ pandora.ui.siteDialog = function(section) { Ox.clone(pandora.site.sitePages), [{id: 'software', title: 'Software'}] ); - Ox.print('SITE DIALOG', section, tabs) - Ox.getObjectById(tabs, section).selected = true; + //Ox.getObjectById(tabs, section).selected = true; + tabs[Ox.getPositionById(tabs, section)].selected = true; + //Ox.print('SITE DIALOG', section, Ox.getObjectById(tabs, section), Ox.getObjectById(tabs, section).selected) var $tabPanel = Ox.TabPanel({ content: function(id) { var $content = Ox.Element().css({padding: '16px', overflowY: 'auto'}); @@ -149,6 +150,11 @@ pandora.ui.siteDialog = function(section) { } }); + $dialog.select = function(id) { + $tabPanel.select(id); + return $dialog; + }; + return $dialog; };