[dist][xs]: build.

This commit is contained in:
Rufus Pollock
2014-03-04 20:35:00 +00:00
parent 17420438ca
commit 529a254544

27
dist/recline.js vendored
View File

@@ -3674,14 +3674,16 @@ my.SlickGrid = Backbone.View.extend({
model.set(v); model.set(v);
}); });
this._slickHandler.subscribe(this.grid.onClick,function(e, args){ this._slickHandler.subscribe(this.grid.onClick,function(e, args){
//try catch , because this fail in qunit , but no
//error on browser.
try{e.preventDefault()}catch(e){}
if (args.cell == 0 && self.state.get("gridOptions").enabledDelRow == true){ if (args.cell == 0 && self.state.get("gridOptions").enabledDelRow == true){
// We need to delete the associated model // We need to delete the associated model
var model = data.getModel(args.row); var model = data.getModel(args.row);
model.destroy() model.destroy()
} }
}) ; }) ;
var columnpicker = new Slick.Controls.ColumnPicker(columns, this.grid,
var columnpicker = new Slick.Controls.ColumnPicker(columns, this.grid,
_.extend(options,{state:this.state})); _.extend(options,{state:this.state}));
if (self.visible){ if (self.visible){
@@ -4408,11 +4410,16 @@ my.Pager = Backbone.View.extend({
}, },
onFormSubmit: function(e) { onFormSubmit: function(e) {
e.preventDefault(); e.preventDefault();
var newFrom = parseInt(this.$el.find('input[name="from"]').val()); // filter is 0-based; form is 1-based
newFrom = Math.min(this.model.recordCount, Math.max(newFrom, 1))-1; var formFrom = parseInt(this.$el.find('input[name="from"]').val())-1;
var newSize = parseInt(this.$el.find('input[name="to"]').val()) - newFrom; var formTo = parseInt(this.$el.find('input[name="to"]').val())-1;
newSize = Math.min(Math.max(newSize, 1), this.model.recordCount); var maxRecord = this.model.recordCount-1;
this.model.queryState.set({size: newSize, from: newFrom}); if (this.model.queryState.get('from') != formFrom) { // changed from; update from
this.model.queryState.set({from: Math.min(maxRecord, Math.max(formFrom, 0))});
} else if (this.model.queryState.get('to') != formTo) { // change to; update size
var to = Math.min(maxRecord, Math.max(formTo, 0));
this.model.queryState.set({size: Math.min(maxRecord+1, Math.max(to-formFrom+1, 1))});
}
}, },
onPaginationUpdate: function(e) { onPaginationUpdate: function(e) {
e.preventDefault(); e.preventDefault();
@@ -4422,10 +4429,10 @@ my.Pager = Backbone.View.extend({
var size = this.model.queryState.get('size'); var size = this.model.queryState.get('size');
var updateQuery = false; var updateQuery = false;
if ($el.parent().hasClass('prev')) { if ($el.parent().hasClass('prev')) {
newFrom = Math.max(currFrom - Math.max(0, size), 1)-1; newFrom = Math.max(currFrom - Math.max(0, size), 0);
updateQuery = newFrom != currFrom; updateQuery = newFrom != currFrom;
} else { } else {
newFrom = Math.max(currFrom + size, 1); newFrom = Math.max(currFrom + size, 0);
updateQuery = (newFrom < this.model.recordCount); updateQuery = (newFrom < this.model.recordCount);
} }
if (updateQuery) { if (updateQuery) {