@@ -179,6 +179,10 @@ var ListCollectionCreator = Backbone.View.extend( BASE_MVC.LoggableMixin ).exten
179
179
highlightClr : 'rgba( 64, 255, 255, 1.0 )'
180
180
} ,
181
181
182
+ footerSettings : {
183
+ '.hide-originals' : 'hideOriginals'
184
+ } ,
185
+
182
186
/** set up initial options, instance vars, behaviors */
183
187
initialize : function ( attributes ) {
184
188
this . metric ( 'ListCollectionCreator.initialize' , attributes ) ;
@@ -191,6 +195,7 @@ var ListCollectionCreator = Backbone.View.extend( BASE_MVC.LoggableMixin ).exten
191
195
/** unordered, original list - cache to allow reversal */
192
196
creator . initialElements = attributes . elements || [ ] ;
193
197
198
+ this . _setUpCommonSettings ( ) ;
194
199
this . _instanceSetUp ( ) ;
195
200
this . _elementsSetUp ( ) ;
196
201
this . _setUpBehaviors ( ) ;
@@ -348,15 +353,6 @@ var ListCollectionCreator = Backbone.View.extend( BASE_MVC.LoggableMixin ).exten
348
353
return $middle ;
349
354
} ,
350
355
351
- /** render the footer, completion controls, and cancel controls */
352
- _renderFooter : function ( speed , callback ) {
353
- var $footer = this . $ ( '.footer' ) . empty ( ) . html ( this . templates . footer ( ) ) ;
354
- if ( typeof this . oncancel === 'function' ) {
355
- this . $ ( '.cancel-create.btn' ) . show ( ) ;
356
- }
357
- return $footer ;
358
- } ,
359
-
360
356
/** add any jQuery/bootstrap/custom plugins to elements rendered */
361
357
_addPluginComponents : function ( ) {
362
358
this . $ ( '.help-content i' ) . hoverhighlight ( '.collection-creator' , this . highlightClr ) ;
@@ -513,7 +509,7 @@ var ListCollectionCreator = Backbone.View.extend( BASE_MVC.LoggableMixin ).exten
513
509
} ) ;
514
510
515
511
creator . blocking = true ;
516
- return creator . creationFn ( elements , name )
512
+ return creator . creationFn ( elements , name , creator . hideOriginals )
517
513
. always ( function ( ) {
518
514
creator . blocking = false ;
519
515
} )
@@ -609,6 +605,7 @@ var ListCollectionCreator = Backbone.View.extend( BASE_MVC.LoggableMixin ).exten
609
605
// footer
610
606
'change .collection-name' : '_changeName' ,
611
607
'keydown .collection-name' : '_nameCheckForEnter' ,
608
+ 'change .hide-originals' : '_changeHideOriginals' ,
612
609
'click .cancel-create' : '_cancelCreate' ,
613
610
'click .create-collection' : '_clickCreate' //,
614
611
} ,
@@ -777,6 +774,12 @@ var ListCollectionCreator = Backbone.View.extend( BASE_MVC.LoggableMixin ).exten
777
774
/** creation and cancel controls */
778
775
footer : _ . template ( [
779
776
'<div class="attributes clear">' ,
777
+ '<div class="clear">' ,
778
+ '<label class="setting-prompt pull-right">' ,
779
+ _l ( 'Hide original elements' ) , '?' ,
780
+ '<input class="hide-originals pull-right" type="checkbox" />' ,
781
+ '</label>' ,
782
+ '</div>' ,
780
783
'<div class="clear">' ,
781
784
'<input class="collection-name form-control pull-right" ' ,
782
785
'placeholder="' , _l ( 'Enter a name for your new collection' ) , '" />' ,
@@ -948,7 +951,7 @@ var listCollectionCreatorModal = function _listCollectionCreatorModal( elements,
948
951
function createListCollection ( contents ) {
949
952
var elements = contents . toJSON ( ) ,
950
953
promise = listCollectionCreatorModal ( elements , {
951
- creationFn : function ( elements , name ) {
954
+ creationFn : function ( elements , name , hideSourceItems ) {
952
955
elements = elements . map ( function ( element ) {
953
956
return {
954
957
id : element . id ,
@@ -957,7 +960,7 @@ function createListCollection( contents ){
957
960
src : ( element . history_content_type === 'dataset' ? 'hda' : 'hdca' )
958
961
} ;
959
962
} ) ;
960
- return contents . createHDCA ( elements , 'list' , name ) ;
963
+ return contents . createHDCA ( elements , 'list' , name , hideSourceItems ) ;
961
964
}
962
965
} ) ;
963
966
return promise ;
0 commit comments