cms/app-client/app/routes/tabs/carto.js
author Chloe Laisne <chloe.laisne@gmail.com>
Mon, 26 Sep 2016 19:01:35 +0200
changeset 294 f3dae62a0d8a
parent 291 478cdcc56a63
child 309 6ab16926b675
permissions -rw-r--r--
Add folder icon to treemap

import Ember from 'ember';

export default Ember.Route.extend({

    modelQueryParam: 'world',

    model: function() {
        return this.store.query('geostat', {
            'area': this.get('modelQueryParam'),
            'details': 1
        });
    },

    deactivate: function () {
        this.set('modelQueryParam', 'world');
    },

    setupController: function(controller) {
        this._super(...arguments);
        controller.set('modelQueryParam', this.get('modelQueryParam'));
    },

    actions: {
        setModelQueryParam: function(id) {
            this.set('modelQueryParam', id);
            this.refresh();
        }
    }

});