Fixes data source polluting base proto

Recompile assets
This commit is contained in:
Samuel Georges 2016-02-10 20:22:50 +11:00
parent acfb35cbed
commit 6d8ec9b4dc
5 changed files with 11 additions and 10 deletions

View File

@ -29,7 +29,7 @@
.redactor-box figure:hover .oc-figure-controls{display:block}
.redactor-box .oc-figure-controls.bottom{bottom:-50px;top:auto}
.redactor-box .oc-figure-controls.bottom:after{bottom:auto;top:-10px}
.redactor-box .oc-figure-controls.bottom:before{content:'' !important;display:block;width:0;height:0;border-left:8.5px solid transparent !important;border-right:8.5px solid transparent !important;border-bottom:9px solid #2b3e50 !important;border-top:none;top:-8px}
.redactor-box .oc-figure-controls.bottom:before{content:'' !important;display:block !important;width:0 !important;height:0 !important;border-left:8.5px solid transparent !important;border-right:8.5px solid transparent !important;border-bottom:9px solid #2b3e50 !important;border-top:none;top:-8px}
.redactor-box .oc-figure-controls span{display:inline-block;border:none;background:none;color:#ffffff;vertical-align:top;font-size:14px;width:40px;height:40px;line-height:40px;text-align:center;cursor:pointer}
.redactor-box .oc-figure-controls span:before{line-height:24px}
.redactor-box .oc-figure-controls span:hover{color:#fff;background:rgba(255,255,255,0.1)}

View File

@ -593,7 +593,7 @@ Client.prototype.updateRecord=function(key,recordData){var recordIndex=this.getI
if(recordIndex!==-1){recordData[this.tableObj.options.keyColumn]=key
this.data[recordIndex]=recordData}
else{throw new Error('Record with they key '+key+' is not found in the data set')}}
Base.prototype.deleteRecord=function(key,newRecordData,offset,count,onSuccess){var recordIndex=this.getIndexOfKey(key)
Client.prototype.deleteRecord=function(key,newRecordData,offset,count,onSuccess){var recordIndex=this.getIndexOfKey(key)
if(recordIndex!==-1){this.data.splice(recordIndex,1)
if(this.data.length==0)
this.data.push(newRecordData)
@ -617,7 +617,7 @@ Server.prototype.getRecords=function(offset,count,onSuccess){var handlerName=thi
$.request(handlerName,{data:{offset:offset,count:count}}).done(function(data){onSuccess(data.records,data.count)})}
Server.prototype.createRecord=function(recordData,placement,relativeToKey,offset,count,onSuccess){console.log('createRecord')}
Server.prototype.updateRecord=function(key,recordData){console.log('updateRecord')}
Base.prototype.deleteRecord=function(key,newRecordData,offset,count,onSuccess){console.log('deleteRecord')}
Server.prototype.deleteRecord=function(key,newRecordData,offset,count,onSuccess){console.log('deleteRecord')}
$.oc.table.datasource.server=Server}(window.jQuery);+function($){"use strict";if($.oc.table===undefined)
throw new Error("The $.oc.table namespace is not defined. Make sure that the table.js script is loaded.");if($.oc.table.processor===undefined)
$.oc.table.processor={}

View File

@ -116,7 +116,7 @@
*
* The onSuccess callback parameters: records, totalCount.
*/
Base.prototype.deleteRecord = function(key, newRecordData, offset, count, onSuccess) {
Client.prototype.deleteRecord = function(key, newRecordData, offset, count, onSuccess) {
var recordIndex = this.getIndexOfKey(key)
if (recordIndex !== -1) {

View File

@ -119,7 +119,7 @@
*
* The onSuccess callback parameters: records, totalCount.
*/
Base.prototype.deleteRecord = function(key, newRecordData, offset, count, onSuccess) {
Server.prototype.deleteRecord = function(key, newRecordData, offset, count, onSuccess) {
console.log('deleteRecord')
// var recordIndex = this.getIndexOfKey(key)

View File

@ -420,7 +420,7 @@
Table.prototype.updateScrollbar = function() {
if (!this.options.height)
return
$(this.dataTableContainer.parentNode).data('oc.scrollbar').update()
}
@ -453,7 +453,7 @@
Table.prototype.commitEditedRow = function() {
if (this.editedRowKey === null)
return
var editedRow = this.dataTable.querySelector('tr[data-row="'+this.editedRowKey+'"]')
if (!editedRow)
return
@ -627,11 +627,12 @@
var keyColumn = this.options.keyColumn,
newRecordData = {}
newRecordData[keyColumn] = -1*this.recordsAddedOrDeleted
newRecordData[keyColumn] = -1 * this.recordsAddedOrDeleted
this.dataSource.deleteRecord(key,
this.dataSource.deleteRecord(
key,
newRecordData,
this.navigation.getPageFirstRowOffset(),
this.navigation.getPageFirstRowOffset(),
this.options.recordsPerPage,
function onDeleteRecordDataTableSuccess(records, totalCount) {
self.buildDataTable(records, totalCount)