@ -3,16 +3,16 @@
define (
define (
[
[
'marionette' ,
'marionette' ,
'AddSeries/RootFolders/ CollectionView',
'AddSeries/RootFolders/ RootFolder CollectionView',
'AddSeries/RootFolders/ Collection',
'AddSeries/RootFolders/ RootFolder Collection',
'AddSeries/RootFolders/ Model',
'AddSeries/RootFolders/ RootFolder Model',
'Shared/LoadingView' ,
'Shared/LoadingView' ,
'Mixins/AsValidatedView' ,
'Mixins/AsValidatedView' ,
'Mixins/AutoComplete'
'Mixins/AutoComplete'
] , function ( Marionette , RootFolderCollectionView , RootFolderCollection , RootFolderModel , LoadingView , AsValidatedView ) {
] , function ( Marionette , RootFolderCollectionView , RootFolderCollection , RootFolderModel , LoadingView , AsValidatedView ) {
var layout = Marionette . Layout . extend ( {
var layout = Marionette . Layout . extend ( {
template : 'AddSeries/RootFolders/ LayoutTemplate',
template : 'AddSeries/RootFolders/ RootFolder LayoutTemplate',
ui : {
ui : {
pathInput : '.x-path input'
pathInput : '.x-path input'
@ -23,7 +23,8 @@ define(
} ,
} ,
events : {
events : {
'click .x-add' : '_addFolder'
'click .x-add' : '_addFolder' ,
'keydown .x-path input' : '_keydown'
} ,
} ,
initialize : function ( ) {
initialize : function ( ) {
@ -65,6 +66,14 @@ define(
_showCurrentDirs : function ( ) {
_showCurrentDirs : function ( ) {
this . currentDirs . show ( this . rootfolderListView ) ;
this . currentDirs . show ( this . rootfolderListView ) ;
} ,
_keydown : function ( e ) {
if ( e . keyCode !== 13 ) {
return ;
}
this . _addFolder ( ) ;
}
}
} ) ;
} ) ;