Make reference search / citations work again#100
Conversation
|
The search now works with the above changes. I'm stuck at the Cite tool not doing anything, or rather, just inserting ??? instead of opening the CitePanel and allowing me to Cite something. |
|
I can confirm this also happens outside of the PubSweet context, i.e. by running |
| data: bibEntry.data, | ||
| format: 'citeproc' | ||
| }; | ||
| doc.create(bibItem); |
There was a problem hiding this comment.
I think you need a Surface transaction here:
var surface = this.context.surface;
surface.transaction(function(tx) {
tx.create(bibItem);
});
That's actually intended. The citation gets created with no targets (hence ???) which are specified afterwards. After you used the surface.transaction you should see the EditBibItemPanel appearing. |
|
this.context.surface is undefined: Uncaught TypeError: Cannot read property 'transaction' of undefined doc.create actually works just fine, for some reason... ? The remaining issues which I had is addressed in: substance/substance#571 The click events were being ignored, because I didn't click exactly on the small area of the button. |
|
Ah you are in the panel here... which doesn't have a surface parent. Try this.controller.transaction ? Sorry can't do fixing myself since internet connection is too flaky to do an npm install. |
|
Sorry |
|
I think this is good to go now. |
No description provided.