Skip to content

Commit

Permalink
fixing up the form focus in the admin area fixes #229
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Sep 6, 2010
1 parent 83932cb commit 3a6290d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
12 changes: 1 addition & 11 deletions extensions/libs/webroot/js/infinitas.js
Expand Up @@ -23,15 +23,6 @@ if(typeof Infinitas.params.prefix == 'undefined'){
Infinitas.params.prefix = 'frontend';
}

/**
*
* @access public
* @return void
**/
function focus(){
$(':input:visible:first').focus();
}

switch(Infinitas.params.prefix) {
case 'admin':
require([
Expand All @@ -50,7 +41,7 @@ switch(Infinitas.params.prefix) {
function(require) {
$(document).ready(function(){
$('.tabs').tabs();
focus();
$.FormHelper.foucusOnFirst();
setupAjaxDropdowns();
setupRowSelecting();
setupDatePicker();
Expand Down Expand Up @@ -89,7 +80,6 @@ switch(Infinitas.params.prefix) {
function(require) {
$(document).ready(function(){
$('.tabs').tabs();
focus();
$("#side_bar").show().jixedbar();
//setupStarRating();

Expand Down
11 changes: 11 additions & 0 deletions extensions/libs/webroot/js/libs/form.js
@@ -1,6 +1,17 @@
(function($) {
var FormHelper = $.FormHelper = {};

/**
* Focus on the first available text field, used in admin to make the
* overall usability a bit better.
*
* @access public
* @return void
**/
FormHelper.foucusOnFirst = function(){
$("input:text:visible:first").focus();
}

/**
* generate a form input
*/
Expand Down

0 comments on commit 3a6290d

Please sign in to comment.