[wp-trac] [WordPress Trac] #43620: Privacy Policy page design
WordPress Trac
noreply at wordpress.org
Tue Apr 17 10:48:20 UTC 2018
#43620: Privacy Policy page design
------------------------------+---------------------------------
Reporter: melchoyce | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Resolution:
Keywords: gdpr needs-patch | Focuses: ui, administration
------------------------------+---------------------------------
Comment (by xkon):
@azaozz about the `todo: folding` that you have above I've been playing
with some stuff but ended up on a super basic jQ iteration just for the
sake of prevewing things. ( this is not for a patch ofc )
I think that one good spot would probably be a button though somewhere
with the `Copy` one to Hide/Show more.
By adding a button we could:
1] trim the incoming text with php and just add an extra 'hidden'
placeholder for the full text, to avoid UI flickering :)
2] avoid copying the 'Read More / Read Less' text when pressing Copy
button
{{{
var desc_policy_text = $('.policy-text').find('p:first');
desc_policy_text.each(function(){
$(this).append('...<a href="#" class="more">Read More</a><span><a
href="#" class="less">Read Less</a><span>');
$(this).siblings().toggle();
$(this).find('a.less').toggle();
})
$('a.more').click(function(e){
e.preventDefault();
$(this).parent().siblings().toggle();
$(this).toggle();
$(this).siblings().find('a.less').toggle();
});
$('a.less').click(function(e){
e.preventDefault();
$(this).parent().parent().siblings().toggle();
$(this).toggle();
$(this).parent().parent().find('a.more').toggle();
});
}}}
Gif of this small jQ snippet following
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43620#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list