Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Commit

Permalink
WIP: widget rendered
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Barrenechea committed May 23, 2016
1 parent 538ae76 commit df792c0
Show file tree
Hide file tree
Showing 15 changed files with 549 additions and 331 deletions.
13 changes: 0 additions & 13 deletions app/assets/javascripts/compare/models/WidgetModel.js

This file was deleted.

16 changes: 6 additions & 10 deletions app/assets/javascripts/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ require([
'jquery',
'd3',
'backbone',
'compare/router',
'embed/PantropicalView'
], function($, d3, Backbone, RouterView, PantropicalView) {
'embed/router'
], function($, d3, Backbone, RouterView) {

'use strict';

Expand All @@ -17,7 +16,6 @@ require([

initialize: function() {
this._initRouter();
this._initViews();
this._initApp();
},

Expand All @@ -26,19 +24,17 @@ require([
*/
_initApp: function() {
if (!Backbone.History.started) {
Backbone.history.start({pushState: true});
Backbone.history.start({
pushState: true,
root: '/embed'
});
}
},

_initRouter: function() {
this.router = new RouterView();
},

_initViews: function() {
new PantropicalView();
// new CountryEmbedView();
}

});

new ComparePage();
Expand Down
307 changes: 0 additions & 307 deletions app/assets/javascripts/embed/PantropicalView.js

This file was deleted.

23 changes: 23 additions & 0 deletions app/assets/javascripts/embed/models/CountryModel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
define([
'mps',
'backbone',
'jquery'
], function(mps, Backbone, $) {

var CountryModel = Backbone.Model.extend({

url: '/api/countries/',

initialize: function(setup) {
this.url += setup.iso;
},

parse: function(data) {
return data.country;
}

});

return CountryModel;

});

0 comments on commit df792c0

Please sign in to comment.