mobile: Fix desktop mode

(plugins would not be reachable)
This commit is contained in:
fkloft 2013-12-17 16:46:16 +01:00
parent f1aaad3c22
commit f2b3f3466e
4 changed files with 11 additions and 5 deletions

View File

@ -157,3 +157,9 @@ window.runOnSmartphonesAfterBoot = function() {
window.MAX_DRAWN_LINKS = 200; window.MAX_DRAWN_LINKS = 200;
window.MAX_DRAWN_FIELDS = 100; window.MAX_DRAWN_FIELDS = 100;
} }
window.useAndroidPanes = function() {
// isSmartphone is important to disable panes in desktop mode
return (typeof android !== 'undefined' && android && android.addPane && window.isSmartphone());
}

View File

@ -948,7 +948,7 @@
$('body').append(window.plugin.bookmarks.htmlBkmrksBox); $('body').append(window.plugin.bookmarks.htmlBkmrksBox);
$('#bookmarksBox').css("display", "none").addClass("mobile"); $('#bookmarksBox').css("display", "none").addClass("mobile");
if(typeof android !== 'undefined' && android && android.addPane) if(window.useAndroidPanes())
android.addPane("plugin-bookmarks", "Bookmarks", "ic_action_star"); android.addPane("plugin-bookmarks", "Bookmarks", "ic_action_star");
window.addHook('paneChanged', window.plugin.bookmarks.onPaneChanged); window.addHook('paneChanged', window.plugin.bookmarks.onPaneChanged);

View File

@ -184,7 +184,7 @@ window.plugin.portalcounts.getPortals = function (){
var total = self.enlP + self.resP + self.neuP; var total = self.enlP + self.resP + self.neuP;
var title = total + ' ' + (total == 1 ? 'portal' : 'portals'); var title = total + ' ' + (total == 1 ? 'portal' : 'portals');
if(typeof android !== 'undefined' && android && android.addPane) { if(window.useAndroidPanes()) {
$('<div id="portalcounts" class="mobile">' $('<div id="portalcounts" class="mobile">'
+ '<div class="ui-dialog-titlebar"><span class="ui-dialog-title ui-dialog-title-active">' + title + '</span></div>' + '<div class="ui-dialog-titlebar"><span class="ui-dialog-title ui-dialog-title-active">' + title + '</span></div>'
+ counts + counts
@ -307,7 +307,7 @@ window.plugin.portalcounts.onPaneChanged = function(pane) {
}; };
var setup = function() { var setup = function() {
if(typeof android !== 'undefined' && android && android.addPane) { if(window.useAndroidPanes()) {
android.addPane("plugin-portalcounts", "Portal counts", "ic_action_data_usage"); android.addPane("plugin-portalcounts", "Portal counts", "ic_action_data_usage");
addHook("paneChanged", window.plugin.portalcounts.onPaneChanged); addHook("paneChanged", window.plugin.portalcounts.onPaneChanged);
} else { } else {

View File

@ -114,7 +114,7 @@ window.plugin.portalslist.displayPL = function() {
html = '<table><tr><td>Nothing to show!</td></tr></table>'; html = '<table><tr><td>Nothing to show!</td></tr></table>';
}; };
if(typeof android !== 'undefined' && android && android.addPane) { if(window.useAndroidPanes()) {
$('<div id="portalslist" class="mobile">' + html + '</div>').appendTo(document.body); $('<div id="portalslist" class="mobile">' + html + '</div>').appendTo(document.body);
} else { } else {
dialog({ dialog({
@ -248,7 +248,7 @@ window.plugin.portalslist.onPaneChanged = function(pane) {
}; };
var setup = function() { var setup = function() {
if(typeof android !== 'undefined' && android && android.addPane) { if(window.useAndroidPanes()) {
android.addPane("plugin-portalslist", "Portals list", "ic_action_paste"); android.addPane("plugin-portalslist", "Portals list", "ic_action_paste");
addHook("paneChanged", window.plugin.portalslist.onPaneChanged); addHook("paneChanged", window.plugin.portalslist.onPaneChanged);
} else { } else {