\
\
\
\
\
'+title+'
\
'+weburl+'
\
\
\
'+desc+'
\
'+collection+'\
\
\
\
\
';
$('#bookmarkData').append(bmColData);
$('#bookmarkData1').append(bmColData);
$('#exampleModal').modal('toggle');
$('#bookmark-form').find('input[type="text"],textarea').val('');
}
}
// edit contact
function editBookmark(index_var){
var title = $(".title_"+index_var).html();
var weburl = $(".weburl_"+index_var).html();
var desc = $(".desc_"+index_var).html();
$("#edittitle").val(title);
$("#editurl").val(weburl);
$("#editdesc").val(desc);
}
// favourites bookmark
var fav_arr = [];
function setFavourite(index_var){
$(".favourite_"+index_var).toggleClass("favourite");
var title = $(".title_"+index_var).html();
var weburl=$(".weburl_"+index_var).html();
var desc = $(".desc_"+index_var).html();
var collection = $(".collection_"+index_var).html();
var n = fav_arr.includes(index_var);
console.log(fav_arr);
console.log(n);
if(n){
for( var i = 0; i < fav_arr.length; i++){
if ( fav_arr[i] === index_var) {
fav_arr.splice(i, 1);
}
}
$(".favourite_card_"+index_var).hide();
}
else {
fav_arr.push(index_var);
var bmColData = '
\
\
\
\
\
'+title+'
\
'+weburl+'
\
\
\
'+desc+'
\
'+collection+'\
\
\
\
\
';
$('#favouriteData').append(bmColData);
}
if (fav_arr.length == 0) {
$(".no-favourite").show();
} else {
$(".no-favourite").hide();
}
}
// list-view
$('.grid-bookmark-view').on('click', function(e) {
$('.details-bookmark').removeClass("list-bookmark");
});
$('.list-layout-view').on('click', function(e) {
$(".details-bookmark").css("opacity","0.2");
$('.details-bookmark').addClass("list-bookmark");
setTimeout(function(){
$(".details-bookmark").css("opacity","1");
}, 500);
});