var vent = require('vent'); var Backgrid = require('backgrid'); module.exports = Backgrid.Row.extend({ className : 'log-file-row', events : { 'click' : '_showDetails' }, _showDetails : function() { vent.trigger(vent.Commands.ShowLogFile, { model : this.model }); } });
}, close: function() { this.remove(); this.unbind(); } }); exports.contextMenu = ContextMenu; // UTILS var ClickableRow = Backgrid.Row.extend({ events: { "click": "onClick" }, onClick: function (e) { e.preventDefault() if(e.target.className.indexOf('string-cell') != -1 || e.target.className.indexOf('moment-cell') != -1) { var url = this.model.urlRoot.split('/') Backbone.middle.trigger("goTo", '/' + url[2] + '/' + this.model.id) } } }); exports.clickableRow = ClickableRow var DocumentRow = Backgrid.Row.extend({ events: { "click": "onClick", "click .delete-document": "onRemove" }, onClick: function (e) { e.preventDefault(); Backbone.middle.trigger("goToExt", '/archivist.html#state=composer.main;0.path='+this.model.get('id')+';1.contextId=toc');
var _ = require('underscore'); var Backgrid = require('backgrid'); module.exports = 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:row:fileselected', this.model); } else { this.model.collection.trigger('filebrowser:row:folderselected', this.model); } } });