less stupid initalization of subviews

This commit is contained in:
Arthur Schiwon 2015-08-21 20:05:50 +02:00 committed by Vincent Petry
parent ffd4e0dc5a
commit 8f3884145e
1 changed files with 11 additions and 11 deletions

View File

@ -93,18 +93,18 @@
configModel: this.configModel
};
this.resharerInfoView = _.isUndefined(options.resharerInfoView)
? new OC.Share.ShareDialogResharerInfoView(subViewOptions)
: options.resharerInfoView;
this.linkShareView = _.isUndefined(options.linkShareView)
? new OC.Share.ShareDialogLinkShareView(subViewOptions)
: options.linkShareView;
this.expirationView = _.isUndefined(options.expirationView)
? new OC.Share.ShareDialogExpirationView(subViewOptions)
: options.expirationView;
var subViews = {
resharerInfoView: 'ShareDialogResharerInfoView',
linkShareView: 'ShareDialogLinkShareView',
expirationView: 'ShareDialogExpirationView'
};
for(var name in subViews) {
var className = subViews[name];
this[name] = _.isUndefined(options[name])
? new OC.Share[className](subViewOptions)
: options[name];
}
},
render: function() {