Skip to content

Commit

Permalink
Fix reloading smartmobile view on a non-mailbox page
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Jun 11, 2014
1 parent f0d80eb commit a0595ca
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 29 deletions.
28 changes: 16 additions & 12 deletions imp/js/smartmobile.js
Expand Up @@ -440,15 +440,12 @@ var ImpMobile = {
params.checkcache = 1;
}

params = ImpMobile.addViewportParams($.extend(params, {
view: mailbox
}));

if (!ImpMobile.flags) {
params.flag_config = 1;
}

HordeMobile.doAction('smartmobileViewport', params);
HordeMobile.doAction(
'smartmobileViewport',
ImpMobile.addViewportParams($.extend(params, {
view: mailbox
}))
);
},

/**
Expand All @@ -457,7 +454,8 @@ var ImpMobile = {
{
params = params || {};

var ob = ImpMobile.cache[ImpMobile.mailbox], slice;
var p, slice,
ob = ImpMobile.cache[ImpMobile.mailbox];

if (ob) {
params.cache = ImpMobile.toUidString(ob.cachedIds());
Expand All @@ -473,10 +471,16 @@ var ImpMobile = {
params.slice = '1:' + slice;
}

return {
p = {
view: params.view,
viewport: JSON.stringify(params)
};

if (!ImpMobile.flags) {
p.flag_config = 1;
}

return p;
},

/**
Expand Down Expand Up @@ -530,7 +534,7 @@ var ImpMobile = {
if (!ob) {
if (HordeMobile.currentPage() != 'folders') {
HordeMobile.doAction(
'smartmobileViewport',
'viewPort',
ImpMobile.addViewportParams({
checkcache: 1,
view: ImpMobile.mailbox
Expand Down
24 changes: 7 additions & 17 deletions imp/lib/Ajax/Application/Handler/Smartmobile.php
Expand Up @@ -14,6 +14,9 @@
/**
* Defines AJAX actions used exclusively in the IMP smartmobile view.
*
* Global tasks:
- flag_config: (boolean) True if flag information is needed.
*
* @author Michael Slusarz <slusarz@horde.org>
* @category Horde
* @copyright 2012-2014 Horde LLC
Expand All @@ -34,6 +37,10 @@ public function __construct(Horde_Core_Ajax_Application $base)

/* Disable implicit polling - not used in smartmobile for now. */
$base->queue->poll(null);

if ($this->vars->flag_config) {
$base->queue->flagConfig(Horde_Registry::VIEW_SMARTMOBILE);
}
}

/**
Expand Down Expand Up @@ -165,21 +172,4 @@ public function smartmobileSendMessage()
return $this->_base->callAction('sendMessage');
}

/**
* AJAX action: Output ViewPort data.
*
* @see IMP_Ajax_Application_Handler_Common#viewPort()
*
* Additional variables used:
* - flag_config: (boolean) True if flag information is needed.
*/
public function smartmobileViewport()
{
if ($this->vars->flag_config) {
$this->_base->queue->flagConfig(Horde_Registry::VIEW_SMARTMOBILE);
}

return $this->_base->callAction('viewPort');
}

}

0 comments on commit a0595ca

Please sign in to comment.