cms/app-client/app/routes/tabs/carto.js
author Chloe Laisne <chloe.laisne@gmail.com>
Sun, 25 Sep 2016 20:05:56 +0200
changeset 291 478cdcc56a63
parent 283 beebc85e0c6b
child 309 6ab16926b675
permissions -rw-r--r--
Reset geonames model parameter when coming back to cartography tab

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();
        }
    }

});