diff options
-rw-r--r-- | core/controllers/albums.php | 5 | ||||
-rw-r--r-- | core/js/albums_form_add.js | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/core/controllers/albums.php b/core/controllers/albums.php index 3ab50028..adf9a282 100644 --- a/core/controllers/albums.php +++ b/core/controllers/albums.php @@ -112,7 +112,7 @@ class Albums_Controller extends Items_Controller { } else { print json_encode( array("result" => "error", - "form" => $form->__toString())); + "form" => $form->__toString() . html::script("core/js/albums_form_add.js"))); } } @@ -189,7 +189,8 @@ class Albums_Controller extends Items_Controller { switch ($this->input->get("type")) { case "album": - print album::get_add_form($album); + print album::get_add_form($album) . + html::script("core/js/albums_form_add.js"); break; case "photo": diff --git a/core/js/albums_form_add.js b/core/js/albums_form_add.js new file mode 100644 index 00000000..5516a468 --- /dev/null +++ b/core/js/albums_form_add.js @@ -0,0 +1,5 @@ +$("#gAddAlbumForm input[name=title]").keyup( + function() { + $("#gAddAlbumForm input[name=name]").attr( + "value", $("#gAddAlbumForm input[name=title]").attr("value")); + }); |