Skip to content

Commit

Permalink
fix(product-quick-edit): author not selected in product quick edit fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbir1991 committed May 9, 2018
1 parent e89cbd2 commit df32867
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 29 deletions.
14 changes: 0 additions & 14 deletions assets/js/dokan-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,5 @@ jQuery(function($) {

btn.parents('.dokan-settings-radio-image').addClass('active').removeClass('not-active');
});

$(function(){
$('#the-list').on('click', '.editinline', function(){
var post_id = $(this).closest('tr').attr('id');

post_id = post_id.replace("post-", "");

var $vendor_id_inline_data = $('#dokan_vendor_id_inline_' + post_id).find('#dokan_vendor_id').text(),
$wc_inline_data = $('#woocommerce_inline_' + post_id );

$( 'select[name="dokan_product_author_override"] option:selected', '.inline-edit-row' ).attr( 'selected', false ).change();
$( 'select[name="dokan_product_author_override"] option[value="' + $vendor_id_inline_data + '"]' ).attr( 'selected', 'selected' ).change();
});
});
});

14 changes: 0 additions & 14 deletions assets/src/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,5 @@ jQuery(function($) {

btn.parents('.dokan-settings-radio-image').addClass('active').removeClass('not-active');
});

$(function(){
$('#the-list').on('click', '.editinline', function(){
var post_id = $(this).closest('tr').attr('id');

post_id = post_id.replace("post-", "");

var $vendor_id_inline_data = $('#dokan_vendor_id_inline_' + post_id).find('#dokan_vendor_id').text(),
$wc_inline_data = $('#woocommerce_inline_' + post_id );

$( 'select[name="dokan_product_author_override"] option:selected', '.inline-edit-row' ).attr( 'selected', false ).change();
$( 'select[name="dokan_product_author_override"] option[value="' + $vendor_id_inline_data + '"]' ).attr( 'selected', 'selected' ).change();
});
});
});

18 changes: 17 additions & 1 deletion includes/wc-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function dokan_author_field_quick_edit(){
$user_query = new WP_User_Query( array( 'role' => 'seller' ) );
$sellers = $user_query->get_results();
?>
<div class="dokan-product-author-field">
<div class="dokan-product-author-field inline-edit-group">
<label class="alignleft">
<span class="title"><?php _e( 'Vendor', 'dokan-lite' ); ?></span>
<span class="input-text-wrap">
Expand All @@ -151,6 +151,22 @@ function dokan_author_field_quick_edit(){
</span>
</label>
</div>

<script>
;(function($){
$('#the-list').on('click', '.editinline', function(){
var post_id = $(this).closest('tr').attr('id');

post_id = post_id.replace("post-", "");

var $vendor_id_inline_data = $('#dokan_vendor_id_inline_' + post_id).find('#dokan_vendor_id').text(),
$wc_inline_data = $('#woocommerce_inline_' + post_id );

$( 'select[name="dokan_product_author_override"] option:selected', '.inline-edit-row' ).attr( 'selected', false ).change();
$( 'select[name="dokan_product_author_override"] option[value="' + $vendor_id_inline_data + '"]' ).attr( 'selected', 'selected' ).change();
});
})(jQuery);
</script>
<?php
}

Expand Down

0 comments on commit df32867

Please sign in to comment.