|
// Mission Editor
function attachHandler(jQuery) {
$(document).on('nested:fieldAdded', function(event){
var field = event.field;
var acordion_toggle = field.find('.accordion-toggle');
var panel_body = field.find('.panel-body');
field.find(".panel").removeClass("hidden");
// var timestamp = new Date().getUTCMilliseconds();
// var new_id = "collapse_step_" + timestamp;
// acordion_toggle.attr("href", "#" + new_id);
// panel_body.attr("id", new_id);
// //alert(panel_body.id)
})
$('.dropdown-toggle').dropdown();
$('.dropdown-toggle').on('show.bs.dropdown', function () {
$(this).parent().parent().parent().addClass("overflow");
})
$('.validation_dropdown').click(function(e) {
});
$('#steps_container').sortable({
axis:'y',
handle: '.handle',
cursor: 'crosshair',
item: 'div',
update: function(){
console.log("Serialize:" + $('#steps_container').sortable('serialize', {attribute: "id"}, { key: "agent_step" }));
$.ajax({
url: $(this).data('update'),
type: 'post',
data: $('#steps_container').sortable("serialize", {attribute: "id"}, { key: "agent_step" }),
dataType: 'script'
});
}
});
}
$(document).ready(attachHandler);
$(document).load(attachHandler);
|