Sha256: 9f094f19a53e9d8444f9e364ef62da6235de781a41ff4f0d026c70c93db504e8

Contents?: true

Size: 581 Bytes

Versions: 6

Compression:

Stored size: 581 Bytes

Contents

(function($){
	var $el = $('.tree [data-id=<%= node.id %>]');
<% if node.errors.empty? -%>
	var state = $el.find('form').is(':visible');
	$el.html($('<%=j render(:partial => 'amalgam/admin/tree/node', :locals => {:node => node, :collection => node.self_and_descendants}) %>').html());
	if(state)
		$('.tree [data-id=<%= node.id %>] > form').show();
<% else -%>
	 $('<div class="alert alert-error"><%=j(node.errors.full_messages.join(',')) %><a href="#" data-dismiss="alert" class="close">×</a></div>').hide().prependTo($el.children('form')).fadeIn();
<% end -%>
})(window.jQuery)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
amalgam-2.1.4.1 app/views/amalgam/admin/tree/_update.js.erb
amalgam-2.1.4 app/views/amalgam/admin/tree/_update.js.erb
amalgam-2.1.3.1 app/views/amalgam/admin/tree/_update.js.erb
amalgam-2.1.3 app/views/amalgam/admin/tree/_update.js.erb
amalgam-2.1.2 app/views/amalgam/admin/tree/_update.js.erb
amalgam-2.1.1 app/views/amalgam/admin/tree/_update.js.erb