Skip to content

Make reference search / citations work again#100

Open
jure wants to merge 3 commits into
substance:masterfrom
jure:patch-7
Open

Make reference search / citations work again#100
jure wants to merge 3 commits into
substance:masterfrom
jure:patch-7

Conversation

@jure

@jure jure commented May 4, 2016

Copy link
Copy Markdown
Contributor

No description provided.

@jure

jure commented May 4, 2016

Copy link
Copy Markdown
Contributor Author

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

jure commented May 4, 2016

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

michael commented May 4, 2016

Copy link
Copy Markdown
Member

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

jure commented May 4, 2016

Copy link
Copy Markdown
Contributor Author

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

michael commented May 4, 2016

Copy link
Copy Markdown
Member

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

michael commented May 4, 2016

Copy link
Copy Markdown
Member

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

jure commented May 18, 2016

Copy link
Copy Markdown
Contributor Author

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.

2 participants