diff --git a/imp/js/smartmobile.js b/imp/js/smartmobile.js index 4fadaf86294..7dc87ca3718 100644 --- a/imp/js/smartmobile.js +++ b/imp/js/smartmobile.js @@ -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 + })) + ); }, /** @@ -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()); @@ -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; }, /** @@ -530,7 +534,7 @@ var ImpMobile = { if (!ob) { if (HordeMobile.currentPage() != 'folders') { HordeMobile.doAction( - 'smartmobileViewport', + 'viewPort', ImpMobile.addViewportParams({ checkcache: 1, view: ImpMobile.mailbox diff --git a/imp/lib/Ajax/Application/Handler/Smartmobile.php b/imp/lib/Ajax/Application/Handler/Smartmobile.php index a838302d4da..5b178b97e8f 100644 --- a/imp/lib/Ajax/Application/Handler/Smartmobile.php +++ b/imp/lib/Ajax/Application/Handler/Smartmobile.php @@ -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 * @category Horde * @copyright 2012-2014 Horde LLC @@ -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); + } } /** @@ -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'); - } - }