Resolves #1152 -- close level window on close button click

This commit is contained in:
Peter Cottle 2024-06-18 16:17:15 +09:00
parent ad95c98ef2
commit a3cfd3bb88
2 changed files with 14 additions and 1 deletions

View file

@ -60,6 +60,7 @@ var GitDemonstrationView = ContainedBase.extend({
this.navEvents = Object.assign({}, Backbone.Events);
this.navEvents.on('positive', this.positive, this);
this.navEvents.on('negative', this.negative, this);
this.navEvents.on('exit', this.exit, this);
this.navEvents.on('onResetButtonClick', this.onResetButtonClick, this);
this.keyboardListener = new KeyboardListener({
events: this.navEvents,
@ -79,9 +80,16 @@ var GitDemonstrationView = ContainedBase.extend({
}
},
exit: function() {
alert('exittt');
},
receiveMetaNav: function(navView, metaContainerView) {
console.log('receive meta nav');
debugger;
var _this = this;
navView.navEvents.on('positive', this.positive, this);
navView.navEvents.on('exit', this.exit, this);
this.metaContainerView = metaContainerView;
},

View file

@ -314,7 +314,8 @@ var ModalTerminal = ContainedBase.extend({
className: 'modalTerminal box flex1',
template: _.template($('#terminal-window-template').html()),
events: {
'click div.inside': 'onClick'
'click div.inside': 'onClick',
'click div.controls div.close': 'onCloseButtonClick'
},
initialize: function(options) {
@ -333,6 +334,10 @@ var ModalTerminal = ContainedBase.extend({
this.$('.modal-title').text(title);
},
onCloseButtonClick: function() {
console.log('triggering stuff');
},
onClick: function() {
this.navEvents.trigger('click');
},