Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make reference search / citations work again #100

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Make reference search / citations work again #100

wants to merge 3 commits into from

Conversation

jure
Copy link
Contributor

@jure jure commented May 4, 2016

No description provided.

@jure
Copy link
Contributor Author

jure commented May 4, 2016

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.

@jure
Copy link
Contributor Author

jure commented May 4, 2016

I can confirm this also happens outside of the PubSweet context, i.e. by running npm start for Lens.

data: bibEntry.data,
format: 'citeproc'
};
doc.create(bibItem);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need a Surface transaction here:

var surface = this.context.surface;
surface.transaction(function(tx) {
  tx.create(bibItem);
});

@michael
Copy link
Member

michael commented May 4, 2016

I'm stuck at the Cite tool not doing anything, or rather, just inserting ???

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.

@jure
Copy link
Contributor Author

jure commented May 4, 2016

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.

@michael
Copy link
Member

michael commented May 4, 2016

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.

@michael
Copy link
Member

michael commented May 4, 2016

Sorry this.context.controller.transaction..

@jure jure changed the title WIP Make reference search / citations work again Make reference search / citations work again May 18, 2016
@jure
Copy link
Contributor Author

jure commented May 18, 2016

I think this is good to go now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants