.selectable({
filter: 'section',
stop: function(event, ui) {
$(document).find('.sectionTools').remove();
$('.ui-selected').children().append(""
+"<div class='sectionTools'>"
+"<span class='tool tool-move ico'>{}</span> "
+"<span class='tool tool-remove ico'>'</span>"
+"</div>");
// Следующая функция не срабатывает
$('.tool-remove').on( "click", function() {
$('.ui-selected').remove();
});
}
});
var toolremove = $("<span class='tool tool-remove ico'>'</span>").click(function () {
$('.ui-selected').remove();
});
var sectiontools = $("<div class='sectionTools'>"
+"<span class='tool tool-move ico'>{}</span> "
+"</div>").append(toolremove);
$('.ui-selected').children().append(sectiontools);
$('.ui-selected').children().append($("<div class='sectionTools'>"
+"<span class='tool tool-move ico'>{}</span> "
+"<span class='tool tool-remove ico'>'</span>"
+"</div>").children('.tool-remove').click(function() {
$('.ui-selected').remove();
}).parent());