mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-13 10:56:26 +00:00
19 lines
397 B
JavaScript
19 lines
397 B
JavaScript
$(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;
|
|
}
|
|
}
|
|
});
|
|
});
|