| 49 | module.exports = (SearchView = (function () { |
| 50 | SearchView = class SearchView extends RootView { |
| 51 | static initClass () { |
| 52 | this.prototype.template = template |
| 53 | this.prototype.className = 'search-view' |
| 54 | |
| 55 | // to overwrite in subclasses |
| 56 | this.prototype.modelLabel = '' // 'Article' |
| 57 | this.prototype.model = null // Article |
| 58 | this.prototype.modelURL = null // '/db/article' |
| 59 | this.prototype.tableTemplate = null // require 'templates/editor/article/table' |
| 60 | this.prototype.projected = null // ['name', 'description', 'version'] or null for default |
| 61 | this.prototype.canMakeNew = true |
| 62 | this.prototype.archived = true // Include archived game elements |
| 63 | this.prototype.limit = 100 |
| 64 | this.prototype.queryParams = null // include it like 'a=1&b=2' |
| 65 | |
| 66 | this.prototype.events = { |
| 67 | 'change input#search': 'runSearch', |
| 68 | 'keydown input#search': 'runSearch', |
| 69 | 'click #new-model-button': 'newModel', |
| 70 | 'hidden.bs.modal #new-model-modal': 'onModalHidden', |
| 71 | 'click [data-toggle="coco-modal"][data-target="core/CreateAccountModal"]': 'openCreateAccountModal' |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | constructor (options) { |
| 76 | super(options) |