reduce lodash size
This commit is contained in:
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
window._ = require('lodash');
|
||||
window._ = require('./udash');
|
||||
window.Popper = require('popper.js').default
|
||||
|
||||
/**
|
||||
|
||||
@@ -69,6 +69,7 @@ export default {
|
||||
busy (yes) {
|
||||
$('#draft-busy').css('opacity', yes ? 1 : 0)
|
||||
},
|
||||
|
||||
query (data, sucfn, erfn) {
|
||||
this.busy(true)
|
||||
if (!sucfn) sucfn = ()=>{}
|
||||
@@ -80,6 +81,7 @@ export default {
|
||||
this.busy(false)
|
||||
})
|
||||
},
|
||||
|
||||
toggleRowDelete(_id) {
|
||||
let remove = !this.rows[_id]._remove
|
||||
|
||||
@@ -90,6 +92,7 @@ export default {
|
||||
this.$set(this.rows, _id, resp.data)
|
||||
})
|
||||
},
|
||||
|
||||
submitRowChange(row) {
|
||||
this.query({
|
||||
action: 'row.update',
|
||||
@@ -102,6 +105,7 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
toggleRowEditing(_id) {
|
||||
if (this.rows[_id]._remove) return false; // can't edit row marked for removal
|
||||
|
||||
@@ -113,6 +117,7 @@ export default {
|
||||
this.$set(this.rows[_id], '_editing', true);
|
||||
}
|
||||
},
|
||||
|
||||
colClasses(col) {
|
||||
return [
|
||||
'border-top-0',
|
||||
@@ -123,15 +128,18 @@ export default {
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
rowStyle(row) {
|
||||
return {
|
||||
opacity: row._remove? .8 : 1,
|
||||
backgroundColor: row._remove? '#FFC4CC': 'transparent'
|
||||
}
|
||||
},
|
||||
|
||||
isChanged (row, colId) {
|
||||
return row._changed.indexOf(colId) > -1
|
||||
},
|
||||
|
||||
revertCell(row, colId) {
|
||||
this.submitRowChange(_.merge({}, row, { [colId]: row._orig[colId] }))
|
||||
}
|
||||
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// subset of used lodash modules
|
||||
|
||||
export { default as each } from 'lodash-es/each';
|
||||
export { default as isUndefined } from 'lodash-es/isUndefined';
|
||||
export { default as merge } from 'lodash-es/merge';
|
||||
Reference in New Issue
Block a user