Skip to content

Commit

Permalink
All js code is now guaranteed to be loaded after jquerymobile
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Feb 3, 2014
1 parent f6acd53 commit f3fef9a
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions imp/lib/Smartmobile.php
Expand Up @@ -52,6 +52,15 @@ public function __construct(Horde_Variables $vars)

$page_output->addScriptFile('smartmobile.js');
$page_output->addScriptFile('json2.js', 'horde');
$page_output->addScriptFile('jquery.mobile/plugins/listviewtaphold.js');
$page_output->addScriptFile('jquery.mobile/plugins/swipebutton.js', 'horde');
if (IMP_Compose::canCompose()) {
$page_output->addScriptFile('jquery.mobile/plugins/autocomplete.js', 'horde');
$page_output->addScriptFile('jquery.mobile/plugins/textchange.js');
if (IMP_Compose::canUploadAttachment()) {
$page_output->addScriptFile('jquery.mobile/plugins/form.js', 'horde');
}
}

$page_output->smartmobileInit = array_merge(
$page_output->smartmobileInit,
Expand All @@ -76,7 +85,7 @@ public function __construct(Horde_Variables $vars)
*/
public function render()
{
global $injector, $page_output;
global $injector;

$imp_imap = $injector->getInstance('IMP_Factory_Imap')->create();

Expand All @@ -92,18 +101,6 @@ public function render()
if ($imp_imap->access(IMP_Imap::ACCESS_FOLDERS)) {
echo $this->view->render('copymove');
}

/* jQuery Mobile plugins must be loaded AFTER the main mobile script
* is loaded. */
$page_output->addScriptFile('jquery.mobile/plugins/listviewtaphold.js');
$page_output->addScriptFile('jquery.mobile/plugins/swipebutton.js', 'horde');
if (IMP_Compose::canCompose()) {
$page_output->addScriptFile('jquery.mobile/plugins/autocomplete.js', 'horde');
$page_output->addScriptFile('jquery.mobile/plugins/textchange.js');
if (IMP_Compose::canUploadAttachment()) {
$page_output->addScriptFile('jquery.mobile/plugins/form.js', 'horde');
}
}
}

/**
Expand Down

0 comments on commit f3fef9a

Please sign in to comment.