Skip to content

Commit

Permalink
set focus to the rigth input between steps
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrammatiko committed Jul 20, 2017
1 parent 0df4e1b commit 117426b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
16 changes: 4 additions & 12 deletions installation/template/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,17 @@
/** @var JDocumentHtml $this */

// Add Stylesheets
JHtml::_('bootstrap.loadCss', true, $this->direction);
JHtml::_('stylesheet', 'installation/template/css/template.css');
JHtml::_('stylesheet', 'installation/template/css/template.css', array('version' => 'auto'));
JHtml::_('stylesheet', 'media/vendor/font-awesome/css/font-awesome.min.css');

// Output as HTML5
$this->setHtml5(true);

// Add scripts
JHtml::_('behavior.core');
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');

// Add installation js
JHtml::_('script', 'installation/template/js/template.js', array('version' => 'auto'));

// Add Stylesheets
JHtml::_('stylesheet', 'installation/template/css/template.css', array('version' => 'auto'));
// Add script options
$this->addScriptOptions('system.installation', array('url' => JRoute::_('index.php')));

// Load JavaScript message titles
JText::script('ERROR');
Expand All @@ -44,9 +39,6 @@
// Load the JavaScript translated messages
JText::script('INSTL_PROCESS_BUSY');
JText::script('INSTL_FTP_SETTINGS_CORRECT');

// Add script options
$this->addScriptOptions('system.installation', array('url' => JRoute::_('index.php')));
?>
<!DOCTYPE html>
<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
Expand Down
15 changes: 15 additions & 0 deletions installation/template/js/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@
}
};

// Focus to the next field
if (document.getElementById('jform_site_name')) {
document.getElementById('jform_site_name').focus();
}

// Init on dom content loaded event
Joomla.makeRandomDbPrefix = function() {
var numbers = '0123456789', letters = 'abcdefghijklmnopqrstuvwxyz', symbols = numbers + letters;
Expand Down Expand Up @@ -283,6 +288,11 @@
document.getElementById('step1').parentNode.removeChild(document.getElementById('step1'));
document.querySelector('li[data-step="2"]').classList.add('active');
Joomla.scrollTo(document.getElementById('installStep2'), document.getElementById('installStep2').offsetTop);

// Focus to the next field
if (document.getElementById('jform_admin_user')) {
document.getElementById('jform_admin_user').focus();
}
}
}
})
Expand All @@ -299,6 +309,11 @@
document.querySelector('li[data-step="3"]').classList.add('active');
Joomla.scrollTo(document.getElementById('installStep3'), document.getElementById('installStep3').offsetTop);
document.getElementById('setupButton').style.display = 'block';

// Focus to the next field
if (document.getElementById('jform_db_type')) {
document.getElementById('jform_db_type').focus();
}
}
}
})
Expand Down

0 comments on commit 117426b

Please sign in to comment.