parent
d423b40bad
commit
d4fe487e8d
|
@ -1,25 +1,22 @@
|
||||||
import showModal from "discourse/lib/show-modal";
|
import showModal from "discourse/lib/show-modal";
|
||||||
import loadScript from "discourse/lib/load-script";
|
|
||||||
|
|
||||||
export function showUserNotes(store, userId, callback, opts) {
|
export function showUserNotes(store, userId, callback, opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
|
|
||||||
return loadScript("defer/html-sanitizer-bundle").then(() => {
|
return store.find("user-note", { user_id: userId }).then((model) => {
|
||||||
return store.find("user-note", { user_id: userId }).then((model) => {
|
const controller = showModal("user-notes", {
|
||||||
const controller = showModal("user-notes", {
|
model,
|
||||||
model,
|
title: "user_notes.title",
|
||||||
title: "user_notes.title",
|
addModalBodyView: true,
|
||||||
addModalBodyView: true,
|
|
||||||
});
|
|
||||||
controller.reset();
|
|
||||||
|
|
||||||
controller.setProperties({
|
|
||||||
userId,
|
|
||||||
callback,
|
|
||||||
postId: opts.postId,
|
|
||||||
});
|
|
||||||
|
|
||||||
return controller;
|
|
||||||
});
|
});
|
||||||
|
controller.reset();
|
||||||
|
|
||||||
|
controller.setProperties({
|
||||||
|
userId,
|
||||||
|
callback,
|
||||||
|
postId: opts.postId,
|
||||||
|
});
|
||||||
|
|
||||||
|
return controller;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue