thd/web/js/uc.input.js
changeset 104 8e4fe6f3337d
parent 103 d2af8a210f5d
child 105 c8f710cd1fb1
equal deleted inserted replaced
103:d2af8a210f5d 104:8e4fe6f3337d
     1 uc = uc || {};
       
     2 uc.input = uc.input || {};
       
     3 uc.input.file = uc.input.file || {};
       
     4 
       
     5 uc.input.file.build = function(selector) {
       
     6 	var jq_field = jQuery(selector);
       
     7 	var jq_input = jQuery('input[type=file]', jq_field);
       
     8 	var jq_radio = jQuery('li.keep input, li.delete input', jq_field);
       
     9 	if (jq_radio.length > 0) jq_input.attr('disabled', 'disabled');
       
    10 	jQuery('li.replace input', jq_field).focus(function() {
       
    11 		jq_input.removeAttr('disabled');
       
    12 	})
       
    13 	jq_radio.focus(function() {
       
    14 		jq_input.attr('disabled', 'disabled');
       
    15 	});
       
    16 }
       
    17 
       
    18 jQuery(document).ready(function() {
       
    19 	uc.input.file.build('form .field-type-file');
       
    20 });