You've already forked lubo_comment_query
修复插件配置问题
This commit is contained in:
@ -1,19 +1,28 @@
|
||||
import PickleComplate from "../vendor/picomplete/picomplete";
|
||||
|
||||
(function () {
|
||||
new PickleComplate({
|
||||
request: {
|
||||
url: '/programs/construct/append/from_list?',
|
||||
type: 'GET',
|
||||
value: 'from',
|
||||
text: 'from',
|
||||
},
|
||||
config: {
|
||||
type: 'server',
|
||||
target: '#from_select',
|
||||
clickCallback: (target, node) => {
|
||||
target.value = node.value;
|
||||
},
|
||||
},
|
||||
})
|
||||
const pickle_config = {
|
||||
target: '#from_select',
|
||||
suggest: ["alias", "abbr"],
|
||||
clickCallback: (target, node) => {
|
||||
target.value = node.value;
|
||||
}
|
||||
};
|
||||
let local_data_string = window.localStorage.getItem("append_from_list");
|
||||
if (!local_data_string) {
|
||||
return fetch("/programs/construct/append/from_list", {
|
||||
"method": "GET",
|
||||
}).then((response) => response.json()).then((data) => {
|
||||
window.localStorage.setItem("append_from_list", JSON.stringify(data));
|
||||
new PickleComplate({
|
||||
data: data,
|
||||
config: pickle_config,
|
||||
})
|
||||
});
|
||||
} else {
|
||||
new PickleComplate({
|
||||
data: JSON.parse(local_data_string),
|
||||
config: pickle_config,
|
||||
})
|
||||
}
|
||||
})()
|
||||
|
Reference in New Issue
Block a user