Created
February 2, 2014 12:23
-
-
Save elis/8767619 to your computer and use it in GitHub Desktop.
This file contains 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
Ember.Route.extend({ | |
actions: { | |
deleteDataset: function (dataset) { | |
var self = this; | |
var cds = self.controllerFor('bigquery/modals/deleteDataset'), // controller for popup | |
bigquery = self.controllerFor('bigquery'); | |
cds.set('dataset', dataset); | |
cds.set('closeCallback', function (confirmed) { | |
if (confirmed) { | |
dataset.deleteRecord(); | |
dataset.save().then(function(result) { | |
console.log('result from deleting record:', result); | |
dataset.get('project').get('datasets').removeObject(dataset); | |
}); | |
} | |
}); | |
self.render('bigquery/modals/delete-dataset', { | |
outlet: 'modals', | |
into: 'bigquery', | |
controller: cds | |
}); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment