Vue Comments: Comments ported to Vue + DnD fileupload
* Drag and drop files to comment editor to add a file attachment * Using Vue to render comments Since comments now has attachments we need to update the schemas ./manage.py maintenance replace_pillar_node_type_schemas
This commit is contained in:
@@ -1 +1,35 @@
|
||||
export { transformPlaceholder } from './placeholder'
|
||||
export { transformPlaceholder } from './placeholder'
|
||||
export { prettyDate } from './prettydate'
|
||||
export { getCurrentUser, initCurrentUser } from './currentuser'
|
||||
|
||||
|
||||
export function debounced(fn, delay=1000) {
|
||||
let timerId;
|
||||
return function (...args) {
|
||||
if (timerId) {
|
||||
clearTimeout(timerId);
|
||||
}
|
||||
timerId = setTimeout(() => {
|
||||
fn(...args);
|
||||
timerId = null;
|
||||
}, delay);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts error message from error of type String, Error or xhrError
|
||||
* @param {*} err
|
||||
* @returns {String}
|
||||
*/
|
||||
export function messageFromError(err){
|
||||
if (typeof err === "string") {
|
||||
// type String
|
||||
return err;
|
||||
} else if(typeof err.message === "string") {
|
||||
// type Error
|
||||
return err.message;
|
||||
} else {
|
||||
// type xhr probably
|
||||
return xhrErrorResponseMessage(err);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user