Last active
August 29, 2015 14:19
-
-
Save robertscherer/4f47a9fa2d3e54e5aa00 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.Controllers.InstallationConfigurationsIndexController = Frontend.AppController.extend({ | |
_installation: null, | |
startup: function() { | |
// This variable has been assigned from the CakePHP Controller action. | |
this._installation = this.getVar('installation'); | |
this.$('.btn-add-fixture').click(this._onAddFixture.bind(this)); | |
}, | |
_onAddFixture: function() { | |
var url = { | |
controller: 'InstallationConfigurations', | |
action: 'chooseFixture', | |
pass: [this._installation.id] | |
}; | |
this.openDialog(url); | |
}, | |
onFixtureChosen: function(fixtureId) { | |
var url = { | |
controller: 'InstallationConfigurations', | |
action: 'addFixtureToInstallation', | |
pass: [this._installation.id] | |
}; | |
var postData = { | |
fixtureId: fixtureId | |
}; | |
App.Main.UIBlocker.blockElement(this._dom); | |
App.Main.request(url, postData, function(response) { | |
if(this.parentController) { | |
this.parentController.loadFixturesTab(); | |
} | |
}.bind(this)); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment