Merge pull request #16109 from woocommerce/fix/15858

add next button to pointers and allow it to be dismissed
This commit is contained in:
Claudiu Lodromanean 2017-07-13 08:45:49 -07:00 committed by GitHub
commit 287b0107b1
4 changed files with 35 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -5877,3 +5877,12 @@ table.bar_chart {
}
}
}
.wc-pointer {
.wc-pointer-buttons {
.close {
float: left;
margin: 6px 0 0 15px;
}
}
}

View File

@ -239,11 +239,34 @@ class WC_Admin_Pointers {
function show_wc_pointer( id ) {
var pointer = wc_pointers.pointers[ id ];
var options = $.extend( pointer.options, {
pointerClass: 'wp-pointer wc-pointer',
close: function() {
if ( pointer.next ) {
show_wc_pointer( pointer.next );
}
}
},
buttons: function( event, t ) {
var close = '" . esc_js( __( 'Dismiss', 'woocommerce' ) ) . "',
next = '" . esc_js( __( 'Next', 'woocommerce' ) ) . "',
button = $( '<a class=\"close\" href=\"#\">' + close + '</a>' ),
button2 = $( '<a class=\"button button-primary\" href=\"#\">' + next + '</a>' ),
wrapper = $( '<div class=\"wc-pointer-buttons\" />' );
button.bind( 'click.pointer', function(e) {
e.preventDefault();
t.element.pointer('destroy');
});
button2.bind( 'click.pointer', function(e) {
e.preventDefault();
t.element.pointer('close');
});
wrapper.append( button );
wrapper.append( button2 );
return wrapper;
},
} );
var this_pointer = $( pointer.target ).pointer( options );
this_pointer.pointer( 'open' );