Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2016-05-20 06:07:55
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Applying a class to a partial
This being my first foray into admin themes, I’m fumbling around in the dark – but thanks to wet’s example I’m getting somewhere.
However, here’s my problem:
- I’m using some jQuery, injected into
html_head()
, to add a class to existing elements. - The elements in question are the links inside
p.txp-actions
on the Write tab – i.e. Duplicate & View. - It works great on the first visit to the Write tab, but after clicking Save the class disappears.
I’m guessing that it’s something to do with the fact that the elements I’m targeting are inside a partial-ajax-thingy (please insert correct terminology) and they’re being reset.
So my question is … is there a way of making classes stick?
Offline
Re: Applying a class to a partial
Do you really need another class? Each of those links already has a class (txp-new
, txp-clone
, txp-article-view
). You can also use descendant selectors to target them.
No idea on your actual question, though.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
#3 2016-05-20 12:05:10
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: Applying a class to a partial
phiw13 wrote #299169:
Do you really need another class?
It’s the simplest way of styling the links as buttons, by applying a class of txp-button
, which then brings in the standard Hive button style.
Offline
Re: Applying a class to a partial
gomedia wrote #299167:
I’m guessing that it’s something to do with the fact that the elements I’m targeting are inside a partial-ajax-thingy (please insert correct terminology) and they’re being reset.
That would be my guess too. You have to make your jQuery snippet to reapply the class on article saves.
Offline
Pages: 1