\
\
{{{value}}}
\
@@ -1298,6 +1337,7 @@ my.GridRow = Backbone.View.extend({
var cellData = this._fields.map(function(field) {
return {
field: field.id,
+ width: field.get('width'),
value: doc.getFieldValue(field)
};
});
@@ -1795,7 +1835,7 @@ my.Map = Backbone.View.extend({
// on [OpenStreetMap](http://openstreetmap.org).
//
_setupMap: function(){
- var self = this;
+
this.map = new L.Map(this.$map.get(0));
var mapUrl = "http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png";
@@ -1835,14 +1875,6 @@ my.Map = Backbone.View.extend({
this.map.setView(new L.LatLng(0, 0), 2);
- var popup = new L.Popup();
- this.map.on('click', function(e) {
- var latlngStr = '(' + e.latlng.lat.toFixed(3) + ', ' + e.latlng.lng.toFixed(3) + ')';
- popup.setLatLng(e.latlng);
- popup.setContent("You clicked the map at " + latlngStr);
- self.map.openPopup(popup);
- });
-
this.mapReady = true;
},
@@ -2043,10 +2075,11 @@ my.ColumnTransform = Backbone.View.extend({
// # Recline Views
//
-// Recline Views are Backbone Views and in keeping with normal Backbone views
-// are Widgets / Components displaying something in the DOM. Like all Backbone
-// views they have a pointer to a model or a collection and is bound to an
-// element.
+// Recline Views are instances of Backbone Views and they act as 'WUI' (web
+// user interface) component displaying some model object in the DOM. Like all
+// Backbone views they have a pointer to a model (or a collection) and have an
+// associated DOM-style element (usually this element will be bound into the
+// page at some point).
//
// Views provided by core Recline are crudely divided into two types:
//
@@ -2262,12 +2295,11 @@ my.DataExplorer = Backbone.View.extend({
}
this.model.bind('query:start', function() {
- self.notify({message: 'Loading data', loader: true});
+ self.notify({loader: true, persist: true});
});
this.model.bind('query:done', function() {
self.clearNotifications();
self.el.find('.doc-count').text(self.model.docCount || 'Unknown');
- self.notify({message: 'Data loaded', category: 'success'});
});
this.model.bind('query:fail', function(error) {
self.clearNotifications();
@@ -2432,19 +2464,25 @@ my.DataExplorer = Backbone.View.extend({
// * loader: if true show loading spinner
notify: function(flash) {
var tmplData = _.extend({
- message: '',
- category: 'warning'
+ message: 'Loading',
+ category: 'warning',
+ loader: false
},
flash
);
- var _template = ' \
-
× \
- {{message}} \
- {{#loader}} \
+ if (tmplData.loader) {
+ var _template = ' \
+
\
+ {{message}} \
\
- {{/loader}} \
-
';
- var _templated = $.mustache(_template, tmplData);
+
';
+ } else {
+ var _template = ' \
+
';
+ }
+ var _templated = $($.mustache(_template, tmplData));
_templated = $(_templated).appendTo($('.recline-data-explorer .alert-messages'));
if (!flash.persist) {
setTimeout(function() {
@@ -2460,7 +2498,9 @@ my.DataExplorer = Backbone.View.extend({
// Clear all existing notifications
clearNotifications: function() {
var $notifications = $('.recline-data-explorer .alert-messages .alert');
- $notifications.remove();
+ $notifications.fadeOut(1500, function() {
+ $(this).remove();
+ });
}
});