Sha256: 71b684aa6bf042df3ffadab28ec16945627b7c511dcddc0c02b8b75e48dfc3a0

Contents?: true

Size: 487 Bytes

Versions: 4

Compression:

Stored size: 487 Bytes

Contents

$(function() {
	$.each($('.clicable_title'), function(index, value) {
		if($(this).val() == '')
		  $(this).val($(this).attr('title'));
	});
	$('.clicable_title').on({
		blur: function() {
			if($(this).val() == '') $(this).val($(this).attr('title'));
		},
		click: function() {
			$(this).select();
			if($(this).val() == $(this).attr('title')) $(this).val('');
		}, 
		focus: function() {
			$(this).select();
			if($(this).val() == $(this).attr('title')) $(this).val('');
		}
	});
});

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mdd-3.1.4 lib/generators/mdwa/sandbox/templates/app/assets/javascripts/mdwa/template/clicable_title.js
mdd-3.1.2 lib/generators/mdwa/sandbox/templates/app/assets/javascripts/mdwa/template/clicable_title.js
mdd-3.1.1 lib/generators/mdwa/sandbox/templates/app/assets/javascripts/mdwa/template/clicable_title.js
mdd-3.1.0 lib/generators/mdwa/sandbox/templates/app/assets/javascripts/mdwa/template/clicable_title.js