Origin commit

This commit is contained in:
Hoang Huu
2019-09-10 11:27:33 +07:00
commit 499e068e4f
844 changed files with 188705 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
(function( $ ) {
'use strict';
$( document ).ready( function() {
$( ".adduser-team" ).delegate( ".remove-user", "click", function() {
if( confirm( $(this).data('alert') ) ){
$(this).parents( '.user-team' ).remove();
}
});
$( '.opalestate-add-user-field' ).each( function() {
var $this = $(this);
$('.button', this).click( function () {
var user_search = $( '.opalestate-adduser-search', $(this).parent().parent() ).val();
$('.opalestate-ajax').show();
var data = {
action: 'opalestate_ajax_search_username',
user_name: user_search,
};
$.ajax({
type: "POST",
data: data,
dataType: "json",
url: ajaxurl,
success: function ( response ) {
if( response.status == true ){
var template = wp.template( 'adduser-team-template' );
$('.adduser-team', $this ).append( template( response.user ) );
}else {
alert( response.message );
}
}
});
} );
} );
} );
})( jQuery );

View File

@@ -0,0 +1,29 @@
.adduser-team{
width: 80%;
}
.user-team{
padding: 12px 10px;
display: block;
border-bottom: solid 1px #f3f3f3
}
.user-team > div{
display: inline-block;
width: 33%;
}
.user-team > div img{
width: 30px;
height: 30px;
border: solid 3px #CCC;
border-radius: 50%;
float: left;
margin-right: 6px;
}
.remove-user {
cursor: pointer;
}
.remove-user:hover {
color: red;
}