{I" class:ETI"ProcessedAsset;FI"logical_path;TI")nested_sortable/inline_operations.js;FI" pathname;TI"{/home/nyitrai/RubymineProjects/jquery_sortable_tree/app/assets/javascripts/nested_sortable/inline_operations.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+õ²ÏSI" length;Ti I" digest;TI"%44c3281a2ef54877a20a56e8cc14eb82;FI" source;TI" (function() { $(function() { $('ol.sortable_tree').siblings('form').on('ajax:success', function(event, data, status, xhr) { var list_item, sortable_tree; sortable_tree = $(this).siblings('ol.sortable_tree'); $(this).find('input').val(''); list_item = sortable_tree.children('li:first').clone(); list_item.find('ol.nested_set').remove(); list_item.find('h4 > a').text(data.name); list_item.find('a.delete').attr('href', function(index, attr) { return attr.replace(list_item.data('node-id'), data.id); }); list_item.data('node-id', data.id); return list_item.appendTo(sortable_tree); }); $('a.delete').on('ajax:success', function() { return $('div.item').has($(this)).parent().remove(); }); return $('ol.sortable_tree h4 > a.edit').on('click', function(event) { var edit_box, edit_done, edit_link, h4, sortable_tree, text, url; event.preventDefault(); sortable_tree = $(this).parents('ol.sortable_tree'); edit_link = $(this); h4 = $(this).parent(); $(this).hide(); url = $(this).attr('href'); text = $(this).text(); edit_box = $(''); edit_box.appendTo(h4.parent()); edit_box.focus(); edit_done = function() { var attributes, data, hide_input_box, title_field; console.log(edit_box.val().trim().length); hide_input_box = function() { edit_link.show(); return edit_box.remove(); }; if (edit_box.val().trim().length > 0) { data = {}; attributes = {}; title_field = 'title'; if (sortable_tree.data('title')) { title_field = sortable_tree.data('title'); } attributes[title_field] = edit_box.val(); data[sortable_tree.data('model')] = attributes; return $.ajax({ type: 'PUT', data: data, url: edit_link.attr('href'), success: function() { edit_link.text(edit_box.val()); return hide_input_box(); }, error: hide_input_box }); } else { return hide_input_box(); } }; edit_box.on('keypress', function(event) { if (event.which === 13) { return $(this).trigger('focusout'); } }); return edit_box.on('focusout', edit_done); }); }); }).call(this); ;TI"dependency_digest;TI"%6e6fdfe879bf56158525e84272dce8cd;FI"required_paths;T[I"{/home/nyitrai/RubymineProjects/jquery_sortable_tree/app/assets/javascripts/nested_sortable/inline_operations.js.coffee;FI"dependency_paths;T[{I" path;TI"{/home/nyitrai/RubymineProjects/jquery_sortable_tree/app/assets/javascripts/nested_sortable/inline_operations.js.coffee;FI" mtime;TI"2014-07-23T15:04:53+02:00;TI" digest;TI"%6622d6bc6bc58ae7562979a000358f13;FI" _version;TI"%3e3098c8a5e9a7f3b984ba95ac600637;F