\n ");
}
/********************************************************************************/
// add new widget
$('#widget_class_list .widget-list .widget-box').on('click', function (e) {
var self = $(this),
containerId = self.parents('#widget_class_list').attr('data-container-id'),
containerSelected = $('#containers .container_section').filter("[data-id=\"".concat(containerId, "\"]")),
sectionListSelected = containerSelected.find('.wrapper_section_list'),
dataForm = {
title: self.data('title'),
namespace: self.data('namespace'),
form: self.data('form')
},
widgetFormRendred = widgetForm(dataForm); // add widget form
sectionListSelected.next('.no-sections').hide();
sectionListSelected.append(widgetFormRendred);
var widgetCreated = sectionListSelected.children('.section-component').last();
widgetCreated.attr('data-container-id', containerId);
window.livewire.rescan();
$(".change_url_type").select2({
minimumResultsForSearch: -1
});
$('html, body').animate({
scrollTop: widgetCreated.offset().top - 200
}, 400);
setTimeout(function () {
widgetCreated.addClass('new');
setTimeout(function () {
widgetCreated.removeClass('new');
}, timerHideNewSection);
}, 300); // hide widget list
$('#widget_class_list').removeClass('open');
});
/********************************************************************************/
// transfrom widget form
function widgetForm(_ref2) {
var title = _ref2.title,
namespace = _ref2.namespace,
form = _ref2.form;
return "\n