onSettingsShown/Hidden call only on parent dialog shown/hidden
jQuery bubbles all children show/hide events up to the parent so the event gets called whenever a settings pane is chosen by the user. Intent of the viewmodel callback was just on first show and final dismiss.
This commit is contained in:
parent
34f1aa421f
commit
dbc2fe9cdb
1 changed files with 15 additions and 11 deletions
|
|
@ -143,19 +143,23 @@ $(function() {
|
|||
};
|
||||
|
||||
self.onAllBound = function(allViewModels) {
|
||||
self.settingsDialog.on('show', function() {
|
||||
_.each(allViewModels, function(viewModel) {
|
||||
if (viewModel.hasOwnProperty("onSettingsShown")) {
|
||||
viewModel.onSettingsShown();
|
||||
}
|
||||
});
|
||||
self.settingsDialog.on('show', function(event) {
|
||||
if (event.target.id == "settings_dialog") {
|
||||
_.each(allViewModels, function(viewModel) {
|
||||
if (viewModel.hasOwnProperty("onSettingsShown")) {
|
||||
viewModel.onSettingsShown();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
self.settingsDialog.on('hidden', function() {
|
||||
_.each(allViewModels, function(viewModel) {
|
||||
if (viewModel.hasOwnProperty("onSettingsHidden")) {
|
||||
viewModel.onSettingsHidden();
|
||||
}
|
||||
});
|
||||
if (event.target.id == "settings_dialog") {
|
||||
_.each(allViewModels, function(viewModel) {
|
||||
if (viewModel.hasOwnProperty("onSettingsHidden")) {
|
||||
viewModel.onSettingsHidden();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
self.settingsDialog.on('beforeSave', function () {
|
||||
_.each(allViewModels, function (viewModel) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue