Skip to content
Browse files

Focus search box instead of toggling add track form when clicking the…

… row in create mode
  • Loading branch information...
1 parent 5fa47d9 commit a3860259b5560b442e9308ac651096b771b76e08 @jwheare committed Dec 15, 2009
Showing with 10 additions and 5 deletions.
  1. +4 −4 src/js/controllers/playlist.controller.js
  2. +6 −1 src/js/main/handlers.js
View
8 src/js/controllers/playlist.controller.js
@@ -80,6 +80,8 @@ Playlist.prototype = {
this.setCurrent();
// Metadata
this.hideMetadata();
+ // Show add track details
+ this.addTrackTable.show();
},
onCreate: function (playlist) {
@@ -147,6 +149,8 @@ Playlist.prototype = {
}
// Update the current playlist object
this.setCurrent(playlist);
+ // Hide add track details
+ this.addTrackTable.hide();
// Load metadata
this.loadMetadata();
// Load tracks
@@ -158,16 +162,12 @@ Playlist.prototype = {
this.loadHeader();
// Footer
this.loadFooter();
- // Hide add track details
- this.addTrackTable.hide();
},
hideMetadata: function () {
// Header
this.showCreateTitle();
// Footer
this.hideFooter();
- // Show add track details
- this.addTrackTable.show();
},
loadHeader: function () {
View
7 src/js/main/handlers.js
@@ -63,7 +63,12 @@ CONTROLLERS.Playlist.trackListElem.click(function (e) {
CONTROLLERS.Playlist.addTrackButton.click(function (e) {
e.preventDefault();
- CONTROLLERS.Playlist.addTrackTable.toggle();
+ if (CONTROLLERS.Playlist.current && !CONTROLLERS.Playlist.current.persisted) {
+ CONTROLLERS.Playlist.addTrackTable.show();
+ CONTROLLERS.Playlist.addTrackSearchInput.focus().select();
+ } else {
+ CONTROLLERS.Playlist.addTrackTable.toggle();
+ }
});
CONTROLLERS.Playlist.addTrackCancel.click(function (e) {
e.preventDefault();

0 comments on commit a386025

Please sign in to comment.
Something went wrong with that request. Please try again.