summaryrefslogtreecommitdiff
path: root/views/js/editable.js
blob: 6bf8e65315494c1f293b727f75232b51bdc142a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

	/**
	 * Wrapper, um die Editierfunktion austauschbarer zu machen
	 */
	jQuery.fn.wspg_editable = function(url, options) {
	
		return this.each(function() {
			
			jQuery(this).editable( { 
				'type': 'text',
				'url': url,
				'pk': 1,
				'ajaxOptions': {
					'type': 'post'
				},
				'params': options['submitdata'],
				'placeholder': wpsg_ajax.ie_placeholder,
				'emptytext': wpsg_ajax.ie_emptytext,
				'validate': function(value) {
					
				    if(jQuery.trim(value) == '') { return wpsg_ajax.ie_validate_empty; }
				    
				}
			} );
			
		} );
	
	}