[build][s]: regular build of js.
This commit is contained in:
23
dist/recline.css
vendored
23
dist/recline.css
vendored
@@ -40,7 +40,6 @@
|
|||||||
|
|
||||||
.recline-graph .graph .alert {
|
.recline-graph .graph .alert {
|
||||||
width: 450px;
|
width: 450px;
|
||||||
margin: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.flotr-mouse-value {
|
.flotr-mouse-value {
|
||||||
@@ -60,7 +59,8 @@
|
|||||||
|
|
||||||
.flotr-legend-color-box {
|
.flotr-legend-color-box {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}/**********************************************************
|
}
|
||||||
|
/**********************************************************
|
||||||
* (Data) Grid
|
* (Data) Grid
|
||||||
*********************************************************/
|
*********************************************************/
|
||||||
|
|
||||||
@@ -255,7 +255,6 @@ div.data-table-cell-content-numeric > a.data-table-cell-edit {
|
|||||||
.recline-read-only a.row-header-menu {
|
.recline-read-only a.row-header-menu {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recline-map .map {
|
.recline-map .map {
|
||||||
height: 500px;
|
height: 500px;
|
||||||
}
|
}
|
||||||
@@ -286,7 +285,6 @@ div.data-table-cell-content-numeric > a.data-table-cell-edit {
|
|||||||
}
|
}
|
||||||
.recline-data-explorer .data-view-container {
|
.recline-data-explorer .data-view-container {
|
||||||
display: block;
|
display: block;
|
||||||
margin-right: 225px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.recline-data-explorer .data-view-sidebar {
|
.recline-data-explorer .data-view-sidebar {
|
||||||
@@ -384,6 +382,7 @@ div.data-table-cell-content-numeric > a.data-table-cell-edit {
|
|||||||
|
|
||||||
.recline-filter-editor {
|
.recline-filter-editor {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recline-filter-editor .filter-term a {
|
.recline-filter-editor .filter-term a {
|
||||||
@@ -401,6 +400,10 @@ div.data-table-cell-content-numeric > a.data-table-cell-edit {
|
|||||||
* Fields Widget
|
* Fields Widget
|
||||||
*********************************************************/
|
*********************************************************/
|
||||||
|
|
||||||
|
.recline-fields-view {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.recline-fields-view .fields-list {
|
.recline-fields-view .fields-list {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
@@ -635,14 +638,17 @@ classes should alter those!
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recline-transform .script {
|
.recline-transform {
|
||||||
margin-right: 10px;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recline-transform .script textarea {
|
.recline-transform .script textarea {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recline-transform h2 {
|
.recline-transform h2 {
|
||||||
@@ -654,10 +660,6 @@ classes should alter those!
|
|||||||
margin-top: -2px;
|
margin-top: -2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recline-transform .preview {
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.expression-preview-parsing-status {
|
.expression-preview-parsing-status {
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
@@ -673,4 +675,3 @@ classes should alter those!
|
|||||||
.recline-transform .before-after .after.different {
|
.recline-transform .before-after .after.different {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
9
dist/recline.dataset.js
vendored
9
dist/recline.dataset.js
vendored
@@ -309,9 +309,11 @@ my.Record = Backbone.Model.extend({
|
|||||||
//
|
//
|
||||||
// For the provided Field get the corresponding rendered computed data value
|
// For the provided Field get the corresponding rendered computed data value
|
||||||
// for this record.
|
// for this record.
|
||||||
|
//
|
||||||
|
// NB: if field is undefined a default '' value will be returned
|
||||||
getFieldValue: function(field) {
|
getFieldValue: function(field) {
|
||||||
val = this.getFieldValueUnrendered(field);
|
val = this.getFieldValueUnrendered(field);
|
||||||
if (field.renderer) {
|
if (field && !_.isUndefined(field.renderer)) {
|
||||||
val = field.renderer(val, field, this.toJSON());
|
val = field.renderer(val, field, this.toJSON());
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
@@ -321,7 +323,12 @@ my.Record = Backbone.Model.extend({
|
|||||||
//
|
//
|
||||||
// For the provided Field get the corresponding computed data value
|
// For the provided Field get the corresponding computed data value
|
||||||
// for this record.
|
// for this record.
|
||||||
|
//
|
||||||
|
// NB: if field is undefined a default '' value will be returned
|
||||||
getFieldValueUnrendered: function(field) {
|
getFieldValueUnrendered: function(field) {
|
||||||
|
if (!field) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
var val = this.get(field.id);
|
var val = this.get(field.id);
|
||||||
if (field.deriver) {
|
if (field.deriver) {
|
||||||
val = field.deriver(val, field, this);
|
val = field.deriver(val, field, this);
|
||||||
|
|||||||
179
dist/recline.js
vendored
179
dist/recline.js
vendored
@@ -76,7 +76,7 @@ this.recline.Backend.Ckan = this.recline.Backend.Ckan || {};
|
|||||||
actualQuery.sort = _tmp.join(',');
|
actualQuery.sort = _tmp.join(',');
|
||||||
}
|
}
|
||||||
return actualQuery;
|
return actualQuery;
|
||||||
}
|
};
|
||||||
|
|
||||||
my.query = function(queryObj, dataset) {
|
my.query = function(queryObj, dataset) {
|
||||||
if (dataset.endpoint) {
|
if (dataset.endpoint) {
|
||||||
@@ -92,7 +92,7 @@ this.recline.Backend.Ckan = this.recline.Backend.Ckan || {};
|
|||||||
jqxhr.done(function(results) {
|
jqxhr.done(function(results) {
|
||||||
var out = {
|
var out = {
|
||||||
total: results.result.total,
|
total: results.result.total,
|
||||||
hits: results.result.records,
|
hits: results.result.records
|
||||||
};
|
};
|
||||||
dfd.resolve(out);
|
dfd.resolve(out);
|
||||||
});
|
});
|
||||||
@@ -116,7 +116,7 @@ this.recline.Backend.Ckan = this.recline.Backend.Ckan || {};
|
|||||||
dataType: 'json'
|
dataType: 'json'
|
||||||
});
|
});
|
||||||
return jqxhr;
|
return jqxhr;
|
||||||
}
|
};
|
||||||
|
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
@@ -130,7 +130,7 @@ this.recline.Backend.Ckan = this.recline.Backend.Ckan || {};
|
|||||||
return {
|
return {
|
||||||
resource_id: parts[len-1],
|
resource_id: parts[len-1],
|
||||||
endpoint: parts.slice(0,[len-4]).join('/') + '/api'
|
endpoint: parts.slice(0,[len-4]).join('/') + '/api'
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
var CKAN_TYPES_MAP = {
|
var CKAN_TYPES_MAP = {
|
||||||
@@ -1207,74 +1207,6 @@ this.recline.Backend.Memory = this.recline.Backend.Memory || {};
|
|||||||
|
|
||||||
}(this.recline.Backend.Memory));
|
}(this.recline.Backend.Memory));
|
||||||
this.recline = this.recline || {};
|
this.recline = this.recline || {};
|
||||||
this.recline.Backend = this.recline.Backend || {};
|
|
||||||
this.recline.Backend.Solr = this.recline.Backend.Solr || {};
|
|
||||||
|
|
||||||
(function($, my) {
|
|
||||||
my.__type__ = 'solr';
|
|
||||||
|
|
||||||
// use either jQuery or Underscore Deferred depending on what is available
|
|
||||||
var Deferred = _.isUndefined(this.jQuery) ? _.Deferred : jQuery.Deferred;
|
|
||||||
|
|
||||||
// ### fetch
|
|
||||||
//
|
|
||||||
// dataset must have a solr or url attribute pointing to solr endpoint
|
|
||||||
my.fetch = function(dataset) {
|
|
||||||
var jqxhr = $.ajax({
|
|
||||||
url: dataset.solr || dataset.url,
|
|
||||||
data: {
|
|
||||||
rows: 1,
|
|
||||||
wt: 'json'
|
|
||||||
},
|
|
||||||
dataType: 'jsonp',
|
|
||||||
jsonp: 'json.wrf'
|
|
||||||
});
|
|
||||||
var dfd = new Deferred();
|
|
||||||
jqxhr.done(function(results) {
|
|
||||||
// if we get 0 results we cannot get fields
|
|
||||||
var fields = []
|
|
||||||
if (results.response.numFound > 0) {
|
|
||||||
fields = _.map(_.keys(results.response.docs[0]), function(fieldName) {
|
|
||||||
return { id: fieldName };
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var out = {
|
|
||||||
fields: fields,
|
|
||||||
useMemoryStore: false
|
|
||||||
};
|
|
||||||
dfd.resolve(out);
|
|
||||||
});
|
|
||||||
return dfd.promise();
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO - much work on proper query support is needed!!
|
|
||||||
my.query = function(queryObj, dataset) {
|
|
||||||
var q = queryObj.q || '*:*';
|
|
||||||
var data = {
|
|
||||||
q: q,
|
|
||||||
rows: queryObj.size,
|
|
||||||
start: queryObj.from,
|
|
||||||
wt: 'json'
|
|
||||||
};
|
|
||||||
var jqxhr = $.ajax({
|
|
||||||
url: dataset.solr || dataset.url,
|
|
||||||
data: data,
|
|
||||||
dataType: 'jsonp',
|
|
||||||
jsonp: 'json.wrf'
|
|
||||||
});
|
|
||||||
var dfd = new Deferred();
|
|
||||||
jqxhr.done(function(results) {
|
|
||||||
var out = {
|
|
||||||
total: results.response.numFound,
|
|
||||||
hits: results.response.docs
|
|
||||||
};
|
|
||||||
dfd.resolve(out);
|
|
||||||
});
|
|
||||||
return dfd.promise();
|
|
||||||
};
|
|
||||||
|
|
||||||
}(jQuery, this.recline.Backend.Solr));
|
|
||||||
this.recline = this.recline || {};
|
|
||||||
this.recline.Data = this.recline.Data || {};
|
this.recline.Data = this.recline.Data || {};
|
||||||
|
|
||||||
(function(my) {
|
(function(my) {
|
||||||
@@ -1718,9 +1650,11 @@ my.Record = Backbone.Model.extend({
|
|||||||
//
|
//
|
||||||
// For the provided Field get the corresponding rendered computed data value
|
// For the provided Field get the corresponding rendered computed data value
|
||||||
// for this record.
|
// for this record.
|
||||||
|
//
|
||||||
|
// NB: if field is undefined a default '' value will be returned
|
||||||
getFieldValue: function(field) {
|
getFieldValue: function(field) {
|
||||||
val = this.getFieldValueUnrendered(field);
|
val = this.getFieldValueUnrendered(field);
|
||||||
if (field.renderer) {
|
if (field && !_.isUndefined(field.renderer)) {
|
||||||
val = field.renderer(val, field, this.toJSON());
|
val = field.renderer(val, field, this.toJSON());
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
@@ -1730,7 +1664,12 @@ my.Record = Backbone.Model.extend({
|
|||||||
//
|
//
|
||||||
// For the provided Field get the corresponding computed data value
|
// For the provided Field get the corresponding computed data value
|
||||||
// for this record.
|
// for this record.
|
||||||
|
//
|
||||||
|
// NB: if field is undefined a default '' value will be returned
|
||||||
getFieldValueUnrendered: function(field) {
|
getFieldValueUnrendered: function(field) {
|
||||||
|
if (!field) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
var val = this.get(field.id);
|
var val = this.get(field.id);
|
||||||
if (field.deriver) {
|
if (field.deriver) {
|
||||||
val = field.deriver(val, field, this);
|
val = field.deriver(val, field, this);
|
||||||
@@ -2116,6 +2055,11 @@ my.Flot = Backbone.View.extend({
|
|||||||
var x = item.datapoint[0].toFixed(2),
|
var x = item.datapoint[0].toFixed(2),
|
||||||
y = item.datapoint[1].toFixed(2);
|
y = item.datapoint[1].toFixed(2);
|
||||||
|
|
||||||
|
if (this.state.attributes.graphType === 'bars') {
|
||||||
|
x = item.datapoint[1].toFixed(2),
|
||||||
|
y = item.datapoint[0].toFixed(2);
|
||||||
|
}
|
||||||
|
|
||||||
var content = _.template('<%= group %> = <%= x %>, <%= series %> = <%= y %>', {
|
var content = _.template('<%= group %> = <%= x %>, <%= series %> = <%= y %>', {
|
||||||
group: this.state.attributes.group,
|
group: this.state.attributes.group,
|
||||||
x: this._xaxisLabel(x),
|
x: this._xaxisLabel(x),
|
||||||
@@ -2126,6 +2070,9 @@ my.Flot = Backbone.View.extend({
|
|||||||
// use a different tooltip location offset for bar charts
|
// use a different tooltip location offset for bar charts
|
||||||
var xLocation, yLocation;
|
var xLocation, yLocation;
|
||||||
if (this.state.attributes.graphType === 'bars') {
|
if (this.state.attributes.graphType === 'bars') {
|
||||||
|
xLocation = item.pageX + 15;
|
||||||
|
yLocation = item.pageY - 10;
|
||||||
|
} else if (this.state.attributes.graphType === 'columns') {
|
||||||
xLocation = item.pageX + 15;
|
xLocation = item.pageX + 15;
|
||||||
yLocation = item.pageY;
|
yLocation = item.pageY;
|
||||||
} else {
|
} else {
|
||||||
@@ -2184,8 +2131,8 @@ my.Flot = Backbone.View.extend({
|
|||||||
if (typeof label !== 'string') {
|
if (typeof label !== 'string') {
|
||||||
label = label.toString();
|
label = label.toString();
|
||||||
}
|
}
|
||||||
if (label.length > 8) {
|
if (self.state.attributes.graphType !== 'bars' && label.length > 10) {
|
||||||
label = label.slice(0, 5) + "...";
|
label = label.slice(0, 10) + "...";
|
||||||
}
|
}
|
||||||
|
|
||||||
return label;
|
return label;
|
||||||
@@ -2204,11 +2151,15 @@ my.Flot = Backbone.View.extend({
|
|||||||
x = 1,
|
x = 1,
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
while (x <= maxTicks) {
|
// show all ticks in bar graphs
|
||||||
if ((numPoints / x) <= maxTicks) {
|
// for other graphs only show up to maxTicks ticks
|
||||||
break;
|
if (self.state.attributes.graphType !== 'bars') {
|
||||||
|
while (x <= maxTicks) {
|
||||||
|
if ((numPoints / x) <= maxTicks) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
x = x + 1;
|
||||||
}
|
}
|
||||||
x = x + 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < numPoints; i = i + x) {
|
for (i = 0; i < numPoints; i = i + x) {
|
||||||
@@ -2311,12 +2262,7 @@ my.Flot = Backbone.View.extend({
|
|||||||
var isDateTime = (xtype === 'date' || xtype === 'date-time' || xtype === 'time');
|
var isDateTime = (xtype === 'date' || xtype === 'date-time' || xtype === 'time');
|
||||||
|
|
||||||
if (isDateTime) {
|
if (isDateTime) {
|
||||||
if (self.state.attributes.graphType != 'bars' &&
|
x = index;
|
||||||
self.state.attributes.graphType != 'columns') {
|
|
||||||
x = new Date(x).getTime();
|
|
||||||
} else {
|
|
||||||
x = index;
|
|
||||||
}
|
|
||||||
} else if (typeof x === 'string') {
|
} else if (typeof x === 'string') {
|
||||||
x = parseFloat(x);
|
x = parseFloat(x);
|
||||||
if (isNaN(x)) {
|
if (isNaN(x)) {
|
||||||
@@ -2964,7 +2910,6 @@ this.recline = this.recline || {};
|
|||||||
this.recline.View = this.recline.View || {};
|
this.recline.View = this.recline.View || {};
|
||||||
this.recline.View.Graph = this.recline.View.Flot;
|
this.recline.View.Graph = this.recline.View.Flot;
|
||||||
this.recline.View.GraphControls = this.recline.View.FlotControls;
|
this.recline.View.GraphControls = this.recline.View.FlotControls;
|
||||||
|
|
||||||
/*jshint multistr:true */
|
/*jshint multistr:true */
|
||||||
|
|
||||||
this.recline = this.recline || {};
|
this.recline = this.recline || {};
|
||||||
@@ -4001,7 +3946,7 @@ my.MultiView = Backbone.View.extend({
|
|||||||
<div class="menu-right"> \
|
<div class="menu-right"> \
|
||||||
<div class="btn-group" data-toggle="buttons-checkbox"> \
|
<div class="btn-group" data-toggle="buttons-checkbox"> \
|
||||||
{{#sidebarViews}} \
|
{{#sidebarViews}} \
|
||||||
<a href="#" data-action="{{id}}" class="btn active">{{label}}</a> \
|
<a href="#" data-action="{{id}}" class="btn">{{label}}</a> \
|
||||||
{{/sidebarViews}} \
|
{{/sidebarViews}} \
|
||||||
</div> \
|
</div> \
|
||||||
</div> \
|
</div> \
|
||||||
@@ -4092,6 +4037,7 @@ my.MultiView = Backbone.View.extend({
|
|||||||
} else {
|
} else {
|
||||||
this.updateNav(this.pageViews[0].id);
|
this.updateNav(this.pageViews[0].id);
|
||||||
}
|
}
|
||||||
|
this._showHideSidebar();
|
||||||
|
|
||||||
this.model.bind('query:start', function() {
|
this.model.bind('query:start', function() {
|
||||||
self.notify({loader: true, persist: true});
|
self.notify({loader: true, persist: true});
|
||||||
@@ -4169,20 +4115,32 @@ my.MultiView = Backbone.View.extend({
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// hide the sidebar if empty
|
||||||
|
_showHideSidebar: function() {
|
||||||
|
var $dataSidebar = this.el.find('.data-view-sidebar');
|
||||||
|
var visibleChildren = $dataSidebar.children().filter(function() {
|
||||||
|
return $(this).css("display") != "none";
|
||||||
|
}).length;
|
||||||
|
|
||||||
|
if (visibleChildren > 0) {
|
||||||
|
$dataSidebar.show();
|
||||||
|
} else {
|
||||||
|
$dataSidebar.hide();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
updateNav: function(pageName) {
|
updateNav: function(pageName) {
|
||||||
this.el.find('.navigation a').removeClass('active');
|
this.el.find('.navigation a').removeClass('active');
|
||||||
var $el = this.el.find('.navigation a[data-view="' + pageName + '"]');
|
var $el = this.el.find('.navigation a[data-view="' + pageName + '"]');
|
||||||
$el.addClass('active');
|
$el.addClass('active');
|
||||||
// show the specific page
|
|
||||||
|
// add/remove sidebars and hide inactive views
|
||||||
_.each(this.pageViews, function(view, idx) {
|
_.each(this.pageViews, function(view, idx) {
|
||||||
if (view.id === pageName) {
|
if (view.id === pageName) {
|
||||||
view.view.el.show();
|
view.view.el.show();
|
||||||
if (view.view.elSidebar) {
|
if (view.view.elSidebar) {
|
||||||
view.view.elSidebar.show();
|
view.view.elSidebar.show();
|
||||||
}
|
}
|
||||||
if (view.view.show) {
|
|
||||||
view.view.show();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
view.view.el.hide();
|
view.view.el.hide();
|
||||||
if (view.view.elSidebar) {
|
if (view.view.elSidebar) {
|
||||||
@@ -4193,12 +4151,25 @@ my.MultiView = Backbone.View.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this._showHideSidebar();
|
||||||
|
|
||||||
|
// call view.view.show after sidebar visibility has been determined so
|
||||||
|
// that views can correctly calculate their maximum width
|
||||||
|
_.each(this.pageViews, function(view, idx) {
|
||||||
|
if (view.id === pageName) {
|
||||||
|
if (view.view.show) {
|
||||||
|
view.view.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
_onMenuClick: function(e) {
|
_onMenuClick: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var action = $(e.target).attr('data-action');
|
var action = $(e.target).attr('data-action');
|
||||||
this['$'+action].toggle();
|
this['$'+action].toggle();
|
||||||
|
this._showHideSidebar();
|
||||||
},
|
},
|
||||||
|
|
||||||
_onSwitchView: function(e) {
|
_onSwitchView: function(e) {
|
||||||
@@ -5230,7 +5201,7 @@ my.Fields = Backbone.View.extend({
|
|||||||
</small> \
|
</small> \
|
||||||
</h4> \
|
</h4> \
|
||||||
</div> \
|
</div> \
|
||||||
<div id="collapse{{id}}" class="accordion-body collapse in"> \
|
<div id="collapse{{id}}" class="accordion-body collapse"> \
|
||||||
<div class="accordion-inner"> \
|
<div class="accordion-inner"> \
|
||||||
{{#facets}} \
|
{{#facets}} \
|
||||||
<div class="facet-summary" data-facet="{{id}}"> \
|
<div class="facet-summary" data-facet="{{id}}"> \
|
||||||
@@ -5249,9 +5220,6 @@ my.Fields = Backbone.View.extend({
|
|||||||
</div> \
|
</div> \
|
||||||
',
|
',
|
||||||
|
|
||||||
events: {
|
|
||||||
'click .js-show-hide': 'onShowHide'
|
|
||||||
},
|
|
||||||
initialize: function(model) {
|
initialize: function(model) {
|
||||||
var self = this;
|
var self = this;
|
||||||
this.el = $(this.el);
|
this.el = $(this.el);
|
||||||
@@ -5269,6 +5237,7 @@ my.Fields = Backbone.View.extend({
|
|||||||
self.model.getFieldsSummary();
|
self.model.getFieldsSummary();
|
||||||
self.render();
|
self.render();
|
||||||
});
|
});
|
||||||
|
this.el.find('.collapse').collapse();
|
||||||
this.render();
|
this.render();
|
||||||
},
|
},
|
||||||
render: function() {
|
render: function() {
|
||||||
@@ -5283,28 +5252,10 @@ my.Fields = Backbone.View.extend({
|
|||||||
});
|
});
|
||||||
var templated = Mustache.render(this.template, tmplData);
|
var templated = Mustache.render(this.template, tmplData);
|
||||||
this.el.html(templated);
|
this.el.html(templated);
|
||||||
this.el.find('.collapse').collapse('hide');
|
|
||||||
},
|
|
||||||
onShowHide: function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
var $target = $(e.target);
|
|
||||||
// weird collapse class seems to have been removed (can watch this happen
|
|
||||||
// if you watch dom) but could not work why. Absence of collapse then meant
|
|
||||||
// we could not toggle.
|
|
||||||
// This seems to fix the problem.
|
|
||||||
this.el.find('.accordion-body').addClass('collapse');;
|
|
||||||
if ($target.text() === '+') {
|
|
||||||
this.el.find('.collapse').collapse('show');
|
|
||||||
$target.text('-');
|
|
||||||
} else {
|
|
||||||
this.el.find('.collapse').collapse('hide');
|
|
||||||
$target.text('+');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery, recline.View);
|
})(jQuery, recline.View);
|
||||||
|
|
||||||
/*jshint multistr:true */
|
/*jshint multistr:true */
|
||||||
|
|
||||||
this.recline = this.recline || {};
|
this.recline = this.recline || {};
|
||||||
@@ -5430,8 +5381,6 @@ my.FilterEditor = Backbone.View.extend({
|
|||||||
var filterType = $target.find('select.filterType').val();
|
var filterType = $target.find('select.filterType').val();
|
||||||
var field = $target.find('select.fields').val();
|
var field = $target.find('select.fields').val();
|
||||||
this.model.queryState.addFilter({type: filterType, field: field});
|
this.model.queryState.addFilter({type: filterType, field: field});
|
||||||
// trigger render explicitly as queryState change will not be triggered (as blank value for filter)
|
|
||||||
this.render();
|
|
||||||
},
|
},
|
||||||
onRemoveFilter: function(e) {
|
onRemoveFilter: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
Reference in New Issue
Block a user