@@ -10,6 +10,8 @@ define([
1010
1111 var ScaffoldAssetView = Backbone . Form . editors . Base . extend ( {
1212
13+ assetType : null ,
14+
1315 events : {
1416 'change input' : function ( ) { this . trigger ( 'change' , this ) ; } ,
1517 'focus input' : function ( ) { this . trigger ( 'focus' , this ) ; } ,
@@ -52,9 +54,13 @@ define([
5254 var inputType = this . schema . inputType ;
5355 var dataUrl = Helpers . isAssetExternal ( this . value ) ? this . value : '' ;
5456
57+ this . assetType = typeof inputType === 'string' ?
58+ inputType . replace ( / A s s e t | : / g, '' ) :
59+ inputType . media ;
60+
5561 this . $el . html ( Handlebars . templates [ this . constructor . template ] ( {
5662 value : this . value ,
57- type : inputType . media || inputType . replace ( 'Asset:' , '' ) ,
63+ type : this . assetType ,
5864 url : id ? 'api/asset/serve/' + id : dataUrl ,
5965 thumbUrl : id ? 'api/asset/thumb/' + id : dataUrl
6066 } ) ) ;
@@ -200,7 +206,7 @@ define([
200206
201207 Origin . trigger ( 'modal:open' , AssetManagementModalView , {
202208 collection : new AssetCollection ,
203- assetType : this . schema . inputType ,
209+ assetType : this . assetType ,
204210 _shouldShowScrollbar : false ,
205211 onUpdate : function ( data ) {
206212 if ( ! data ) return ;
0 commit comments