summaryrefslogtreecommitdiffstats
path: root/static/functions/site_history.js
blob: e354eec686e80887b3c22bfb6fef46758c56dcf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$(document).ready(function() {
	var trimmed = false;
	var tags = $("#tags");
	$("#tag_list").change(function() {
		if (tags.val().length == 0) {
			trimmed = false;
		} else {
			trimmed = true;
		}
		if ($(this).prop("selectedIndex")) {
			tags.val(tags.val() + "," + $(this).val());
			if (!trimmed) {
				tags.val(tags.val().substr(1, tags.val().length));
				trimmed = true;
			}
		}
	});
});