From 9dcc2862e93637695e496fd11fe0c69762baa06a Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Wed, 2 Jun 2010 14:50:27 +0200 Subject: [PATCH] Added method to set iPhone App mode --- www/iphone/example_client.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/www/iphone/example_client.js b/www/iphone/example_client.js index b728f95..cfae8ed 100644 --- a/www/iphone/example_client.js +++ b/www/iphone/example_client.js @@ -37,7 +37,6 @@ var SourceMax = 16; var SubjectMax = 10; var AuthorMax = 10; var tab = "recordview"; -var inApp = false; // @@ -277,10 +276,24 @@ function domReady () document.search.query.value = ''; document.select.sort.onchange = onSelectDdChange; document.select.perpage.onchange = onSelectDdChange; - if (!inApp) - document.getElementById("heading").style.display=""; + applicationMode(true); +} + +function applicationMode(newmode) +{ + var searchdiv = document.getElementById("searchForm"); + if (newmode) + inApp = newmode; + if (inApp) { + document.getElementById("heading").style.display="none"; + searchdiv.style.display = 'none'; + } + else { + searchdiv.style.display = ''; + document.search.onsubmit = onFormSubmit; + } + callback.init(); } - // when search button pressed function onFormSubmitEventHandler() { -- 1.7.10.4