thd/web/js/.svn/text-base/uc.input.js.svn-base
author Gautier Thibault <gthibault@universcine.com>
Tue, 22 Sep 2009 16:40:38 +0200
changeset 35 94a1dc255022
permissions -rw-r--r--
Commit the all thd project created with the framework symfony

uc = uc || {};
uc.input = uc.input || {};
uc.input.file = uc.input.file || {};

uc.input.file.build = function(selector) {
	var jq_field = jQuery(selector);
	var jq_input = jQuery('input[type=file]', jq_field);
	var jq_radio = jQuery('li.keep input, li.delete input', jq_field);
	if (jq_radio.length > 0) jq_input.attr('disabled', 'disabled');
	jQuery('li.replace input', jq_field).focus(function() {
		jq_input.removeAttr('disabled');
	})
	jq_radio.focus(function() {
		jq_input.attr('disabled', 'disabled');
	});
}

jQuery(document).ready(function() {
	uc.input.file.build('form .field-type-file');
});