PDA

View Full Version : Address bar won't hide in iOS, using application and viewport.



kevinv1990
12 Jul 2011, 11:21 AM
Hello everyone,

I have been trying to fix this all day, but I have no idea how-to so i guess it's a bug? It happens not every time, but like one in the five times. pictures are added ;)
26953 26954


I have the following code:



Ext.setup({
useLoadingMask: true,
fullscreen: true,
onReady: function() {
alert('onrdy');
new Ext.Application({
name: 'hireApp',
fullscreen: true,
launch: function() {
this.viewport = new hireserve.views.viewport;
document.body.scrollTop = document.body.scrollHeight; // isn't important i guess?
}
});

}
});


hireserve.views.viewport = Ext.extend (Ext.TabPanel ,{
constructor: function(config){
//Config
config = Ext.apply({
id: 'TabPanel',
cls: 'fadein',
cardSwitchAnimation: 'fade',
fullscreen: true,
monitorOrientation: true,
layoutOnOrientationChange: true,
tabBar: {
id: 'bottomTB',
ui: 'tabui',
dock : 'bottom',
layout: {
pack: 'center'
}
},
listeners: {
afterrender: function(){
Ext.getCmp('TabPanel').el.dom.style.opacity = 1;
hireserve.controllers.showmapmask = true;

var script = document.createElement("script");
script.type = "text/javascript";
script.src = "http://maps.google.com/maps/api/js?sensor=true&callback=hireserve.views.initmap";
document.head.appendChild(script);

if ('standalone' in navigator && !navigator.standalone && (/iphone|ipod|ipad/gi).test(navigator.platform) && (/Safari/i).test(navigator.appVersion)) {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "/icamsbase/mobile/addtohomescreen/src/add2home.js";
document.head.appendChild(script);
}
},
cardswitch: function(tabpanel, newcard, oldcard){
oldcard.setActiveItem(0);
},
tab: function() {
}
},
items: [
hireserve.views.homeandnews,
hireserve.views.joblist1,
hireserve.views.search,
hireserve.views.map,
hireserve.views.more
]
}, config);
// Call base constructor
hireserve.views.viewport.superclass.constructor.call(this, config);
}
});

and one of the items of the viewport (if necessarily)


hireserve.views.search = {
xtype: 'panel',
id: 'searchpanel',
title: text.get('menu_search'),
scroll: 'vertical',
layout: 'card',
iconCls: 'tab_search_black',
items: [{ // card 1
xtype: 'panel',
title: text.get('searchpanel_title'),
id: 'searchformpanel',
layout: {
type: 'fit',
},
scroll: 'vertical',
items: [{
xtype: 'form',
id: 'searchform',
items: [{
xtype: 'fieldset',
id: 'formFieldSet',
cls: 'FormBodyCLS',
items: [{
xtype: 'textfield',
id: 'formterm',
label: text.get('functionlabel')
}, {
xtype: 'selectfield',
id: 'locationselect',
name: 'locationselect',
label: text.get('locationlabel'),
options: [
{text: text.get('loc_all_loc'), value: 'Alllocations'},
{text: text.get('loc_current_loc'), value: 'Currentlocation'},
{text: 'De Meern', value: 'De Meern'},
{text: 'Amsterdam', value: 'Amsterdam'},
{text: 'Utrecht', value: 'Utrecht'}
],
listeners: {
change: function(select, value) {
if(value === 'Alllocations'){
Ext.getCmp('distanceslider').hide();
Ext.getCmp('numberfield').hide();
} else {
Ext.getCmp('distanceslider').show();
Ext.getCmp('numberfield').show();
}
scope: this
}
}
}, {
xtype: 'sliderfield',
id: 'distanceslider',
name: 'distanceslider',
label: text.get('distanceslider'),
minValue: 1,
maxValue: 80,
value: 20,
hidden: true,
cls: 'distanceslidercls',
listeners: {
change: function(slider, component, value) {
Ext.getCmp('numberfield').setValue(value);
scope: this
}
}
}, {
xtype: 'numberfield',
id: 'numberfield',
name: 'numberfield',
cls: 'numberfieldcls',
hidden: true,
value: 20,
listeners: {
change: function(boe, value) {
Ext.getCmp('distanceslider').setValue(value);
scope: this
}
}
}]
},
{
xtype: 'button',
ui: 'confirm',
cls: 'BigFormBtnCLS',
text: text.get('searchbutton'),
handler: hireserve.controllers.searchhandler
}]
}],
dockedItems: [{
xtype: 'topTB',
title: text.get('searchpanel_title')
}]
}, {
xtype: 'detailjobs',
id: 'jobdetails2'
}, {
xtype: 'forwardjob',
id: 'forwardform2'
}],
listeners: {
activate: function(){
//hireserve.controllers.restoreActiveItem();
}
}
}

So if someone can find the problem why 1/5 times this happens, I will be very happy :D

Greetz

kevinv1990
13 Jul 2011, 5:09 AM
Is this a bug which can be fixed next time or must i do some changes? i don't think that my code is wrong at the moment, but if you see something, please tell.