You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.0 KiB

10 years ago
10 years ago
10 years ago
  1. $(function () {
  2. $('[data-toggle="tooltip"]').tooltip();
  3. $(".name-edit input").click(function() {
  4. $form = $(this.parentNode);
  5. if (!$form.hasClass("inactive"))
  6. return;
  7. // Click on all X buttons
  8. $(".name-edit:not(.inactive) .name-edit-cancel").click();
  9. // Make this form editable and store its initial value
  10. $form
  11. .removeClass("inactive")
  12. .data("originalValue", this.value);
  13. });
  14. $(".name-edit-cancel").click(function(){
  15. var $form = $(this.parentNode);
  16. var v = $form.data("originalValue");
  17. $form
  18. .addClass("inactive")
  19. .find(".input-name").val(v);
  20. return false;
  21. });
  22. $(".timeout").click(function() {
  23. $(".timeout-cell").addClass("inactive");
  24. $cell = $(this.parentNode);
  25. $cell.removeClass("inactive");
  26. });
  27. $(".timeout-edit-cancel").click(function() {
  28. $(this).parents("td").addClass("inactive");
  29. return false;
  30. });
  31. });