datatable.directory codebase
https://datatable.directory/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
409 B
22 lines
409 B
7 years ago
|
import { query } from './table-editor-utils'
|
||
|
|
||
|
export default function (dataRoute) {
|
||
|
let $note = $('#field-note')
|
||
|
let lastText = $note.val()
|
||
|
|
||
|
let handler = _.debounce(function () {
|
||
|
query(dataRoute, {
|
||
|
action: 'note.set',
|
||
|
text: lastText
|
||
|
})
|
||
|
}, 350)
|
||
|
|
||
|
$note.on('input', () => {
|
||
|
let text = $note.val()
|
||
|
if (text !== lastText) {
|
||
|
lastText = text
|
||
|
handler()
|
||
|
}
|
||
|
})
|
||
|
}
|