Dismiss button - always on + move to top of panel
- js: CollectNotices - do not remove dismiss-button - css: dismiss button
This commit is contained in:
parent
709617d779
commit
85f56cec68
@ -16,6 +16,7 @@
|
||||
#meta-link-notices-wrap > button.notice-dismiss {
|
||||
position: relative;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.notice_container{
|
||||
|
||||
@ -131,9 +131,7 @@ var NoticeManager = (function ($, document) {
|
||||
*/
|
||||
collectNotices: () => {
|
||||
notices.appendTo(".notice_container").eq(0);
|
||||
$(".notice_container").removeClass("empty");
|
||||
|
||||
if (dismissNoticesButton.length) dismissNoticesButton.detach();
|
||||
$(".notice_container").removeClass("empty"); // .empty removes padding
|
||||
|
||||
/**
|
||||
* When dismissible notices are dismissed, check if any notices are left on page.
|
||||
|
||||
@ -69,14 +69,15 @@ class NoticeManager{
|
||||
/* not JSON-safe - unescaped quotes */
|
||||
function print_notice_manager_panel(){
|
||||
|
||||
// if auto_collect is ON - we don't need the button.
|
||||
// if ( empty( $this->options['auto_collect'] ) )
|
||||
// We ALWAYS print the button!
|
||||
echo '<button type="button" class="notice-dismiss"><span class="screen-reader-text">' . __( 'Dismiss' ) . '</span><strong> Dismiss Notices</strong></button><div></div>' ;
|
||||
|
||||
// NOTE:
|
||||
// button is a copy of is-dismissible button - for styling purposes only
|
||||
// js functionality and listener - js/notice_manager_meta_panel.js
|
||||
echo '<div class="notice_container empty"></div>';
|
||||
|
||||
// if auto_collect is ON - we don't need the button.
|
||||
if ( empty( $this->options['auto_collect'] ) )
|
||||
echo '<button type="button" class="notice-dismiss"><span class="screen-reader-text">' . __( 'Dismiss' ) . '</span><strong> Dismiss Notices</strong></button><div></div>' ;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user