Hi there, As far as I know 'only' is a focusing adverb in the cases you use it as an adverb (for focusing purposes). 'focusing' means that it points to a particular part of a sentence (and slightly [or more] modify it). Therefore both of your examples are right.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.
She olny took them. She didn't do anything else with them.
She only took the positives.