From b00bad39e6b97f5a09375763b4be8d3130f38084 Mon Sep 17 00:00:00 2001 From: Jakob Hilden Date: Wed, 11 Feb 2009 04:38:02 +0000 Subject: improvements on the tag admin --- modules/tag/views/admin_tags.html.php | 104 ++++++++++++---------------------- themes/admin_default/js/ui.init.js | 26 ++++++--- 2 files changed, 55 insertions(+), 75 deletions(-) diff --git a/modules/tag/views/admin_tags.html.php b/modules/tag/views/admin_tags.html.php index 18ce150e..d92f422a 100644 --- a/modules/tag/views/admin_tags.html.php +++ b/modules/tag/views/admin_tags.html.php @@ -1,5 +1,8 @@
@@ -37,79 +41,43 @@ count()/5 ?> - - -
-
- $tag): ?> - name, 0, 1)) ?> - - - -
    - - $tags_per_column): ?> -
-
- - - - - - -
-
+ - +
+ - - - - - $tag): ?> - "> - - + -
count()." tags") ?>
name ?> count ?> -
    + $tag): ?> + name, 0, 1)) ?> + + + +
      + + $tags_per_column): /* new column */ ?> +
+ + + + + +
- -
-
"> -
- - - "/> -
-
-
+
\ No newline at end of file diff --git a/themes/admin_default/js/ui.init.js b/themes/admin_default/js/ui.init.js index a68a5238..d43a5f1d 100644 --- a/themes/admin_default/js/ui.init.js +++ b/themes/admin_default/js/ui.init.js @@ -49,26 +49,38 @@ $(document).ready(function(){ }); -function editInplace(element){ - // close already open inplace edit forms +function closeEditInPlaceForms() { + // closes currently open inplace edit forms if ($("#gRenameTagForm").length) { var li = $("#gRenameTagForm").parent(); $("#gRenameTagForm").parent().html($("#gRenameTagForm").parent().data("revert")); - //li.$(".gEditable"); // TODO: would be good if below statements could only execute within li - $(".gEditable").bind("click", editInplace); - $(".dialogLink").bind("click", handleDialogEvent); + li.height(""); + $(".gEditable", li).bind("click", editInplace); + $(".gDialogLink", li).bind("click", handleDialogEvent); } +} + +function editInplace(element){ + closeEditInPlaceForms(); + // creat edit form var tag_id = $(this).attr('id').substr(5); + var tag_name = $(this).text(); + var tag_width = $(this).width(); $(this).parent().data("revert", $(this).parent().html()); var form = '
'; form += ''; form += ''; form += 'or cancel'; form += '
'; - + + // add edit form $(this).parent().html(form); - $("#gRenameTagForm .textbox").focus(); + $("#gRenameTagForm #name") + .width(tag_width+30) + .focus(); + $("#gRenameTagForm").parent().height('1.6em'); + $("#gRenameTagForm a").bind("click", closeEditInPlaceForms); } function handlePanelEvent(event) { -- cgit v1.2.3