Readarr/src/UI/Shared/FileBrowser/FileBrowserRow.js
Mark McDowall 85a9b74008 File Browser
New: File Browser to navigate to folders when choosing paths
2014-12-19 23:32:47 -08:00

31 lines
No EOL
807 B
JavaScript

'use strict';
define(
[
'underscore',
'backgrid'
], function (_, Backgrid) {
return Backgrid.Row.extend({
className: 'file-browser-row',
events: {
'click': '_selectRow'
},
_originalInit: Backgrid.Row.prototype.initialize,
initialize: function () {
this._originalInit.apply(this, arguments);
},
_selectRow: function () {
if (this.model.get('type') === 'file') {
this.model.collection.trigger('filebrowser:fileselected', this.model);
}
else {
this.model.collection.trigger('filebrowser:folderselected', this.model);
}
}
});
});