Navigation Menu

Skip to content

Commit

Permalink
TAP5-994 updated field autofocus script initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
robink committed Jan 29, 2010
1 parent fed4f94 commit 7b351b7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Expand Up @@ -212,7 +212,7 @@ public void commit()
{
if (focusFieldId != null)
{
addScript("$('%s').activate();", focusFieldId);
addInitFunctionInvocation("activate", focusFieldId);
}

if (init.length() > 0)
Expand Down
Expand Up @@ -697,6 +697,9 @@ Element.addMethods([

/** Container of functions that may be invoked by the Tapestry.init() function. */
Tapestry.Initializer = {
activate: function(element){
$(element).activate();
},

ajaxFormLoop : function(spec)
{
Expand Down
Expand Up @@ -277,7 +277,7 @@ public void field_focus()
{
DocumentLinker linker = mockDocumentLinker();

linker.addScript("$('foo').activate();");
linker.addScript("Tapestry.init({\"activate\":[\"foo\"]});");

replay();

Expand All @@ -295,7 +295,7 @@ public void first_focus_field_at_priority_wins()
{
DocumentLinker linker = mockDocumentLinker();

linker.addScript("$('foo').activate();");
linker.addScript("Tapestry.init({\"activate\":[\"foo\"]});");

replay();

Expand All @@ -314,7 +314,7 @@ public void higher_priority_wins_focus()
{
DocumentLinker linker = mockDocumentLinker();

linker.addScript("$('bar').activate();");
linker.addScript("Tapestry.init({\"activate\":[\"bar\"]});");

replay();

Expand Down

0 comments on commit 7b351b7

Please sign in to comment.