mirror of
https://github.com/Dahlgren/arma-server-web-admin.git
synced 2024-08-30 17:22:10 +00:00
Merge pull request #229 from Dahlgren/bugfix/save-server-mods
Fix save server mods
This commit is contained in:
commit
27df1c9713
@ -26,16 +26,17 @@ module.exports = Marionette.LayoutView.extend({
|
|||||||
|
|
||||||
initialize: function () {
|
initialize: function () {
|
||||||
this.filterValue = ''
|
this.filterValue = ''
|
||||||
|
this.modsListView = new ListView({ collection: this.options.mods, filterValue: this.filterValue })
|
||||||
},
|
},
|
||||||
|
|
||||||
updateFilter: function (event) {
|
updateFilter: function (event) {
|
||||||
this.filterValue = event.target.value
|
this.filterValue = event.target.value
|
||||||
this.listView.currentView.filterValue = this.filterValue
|
this.modsListView.filterValue = this.filterValue
|
||||||
this.listView.currentView.render()
|
this.modsListView.render()
|
||||||
},
|
},
|
||||||
|
|
||||||
onRender: function () {
|
onRender: function () {
|
||||||
this.listView.show(new ListView({ collection: this.options.mods, filterValue: this.filterValue }))
|
this.listView.show(this.modsListView)
|
||||||
},
|
},
|
||||||
|
|
||||||
refresh: function (event) {
|
refresh: function (event) {
|
||||||
|
@ -9,11 +9,24 @@ var template = _.template(tpl)
|
|||||||
module.exports = ModsView.extend({
|
module.exports = ModsView.extend({
|
||||||
template: template,
|
template: template,
|
||||||
|
|
||||||
onRender: function () {
|
modelEvents: {
|
||||||
this.listView.show(new ListView({
|
change: 'serverUpdated'
|
||||||
|
},
|
||||||
|
|
||||||
|
initialize: function (options) {
|
||||||
|
ModsView.prototype.initialize.call(this, options)
|
||||||
|
this.modsListView = new ListView({
|
||||||
collection: this.options.mods,
|
collection: this.options.mods,
|
||||||
server: this.options.server,
|
server: this.options.server,
|
||||||
filterValue: this.filterValue
|
filterValue: this.filterValue
|
||||||
}))
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
serverUpdated: function () {
|
||||||
|
this.modsListView.render()
|
||||||
|
},
|
||||||
|
|
||||||
|
serialize: function () {
|
||||||
|
return this.modsListView.serialize()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -41,7 +41,7 @@ module.exports = Marionette.LayoutView.extend({
|
|||||||
onRender: function () {
|
onRender: function () {
|
||||||
this.infoView.show(new InfoView({ model: this.model }))
|
this.infoView.show(new InfoView({ model: this.model }))
|
||||||
this.missionsView.show(new MissionsView({ missions: this.missions, model: this.model }))
|
this.missionsView.show(new MissionsView({ missions: this.missions, model: this.model }))
|
||||||
this.modsView.show(new ModsView({ mods: this.mods, server: this.model }))
|
this.modsView.show(new ModsView({ model: this.model, mods: this.mods, server: this.model }))
|
||||||
this.parametersView.show(new ParametersListView({ model: this.model }))
|
this.parametersView.show(new ParametersListView({ model: this.model }))
|
||||||
this.playersView.show(new PlayersView({ model: this.model }))
|
this.playersView.show(new PlayersView({ model: this.model }))
|
||||||
this.settingsView.show(new FormView({ model: this.model }))
|
this.settingsView.show(new FormView({ model: this.model }))
|
||||||
@ -49,7 +49,6 @@ module.exports = Marionette.LayoutView.extend({
|
|||||||
|
|
||||||
serverUpdated: function () {
|
serverUpdated: function () {
|
||||||
this.infoView.currentView.render()
|
this.infoView.currentView.render()
|
||||||
this.modsView.currentView.render()
|
|
||||||
this.parametersView.currentView.render()
|
this.parametersView.currentView.render()
|
||||||
this.playersView.currentView.render()
|
this.playersView.currentView.render()
|
||||||
this.settingsView.currentView.render()
|
this.settingsView.currentView.render()
|
||||||
|
Loading…
Reference in New Issue
Block a user