From 7cf0313e7b8672d9757f565fd72c8e7dcf1a8904 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 17 Mar 2009 20:59:24 +0000 Subject: Remove the in-place tag editing code from the default theme. It should be implemented in the tags module for now, and then possibly generalized out to lib later on. --- themes/admin_default/js/ui.init.js | 50 +++++--------------------------------- 1 file changed, 6 insertions(+), 44 deletions(-) (limited to 'themes/admin_default/js/ui.init.js') diff --git a/themes/admin_default/js/ui.init.js b/themes/admin_default/js/ui.init.js index d0406b39..fe8a76ac 100644 --- a/themes/admin_default/js/ui.init.js +++ b/themes/admin_default/js/ui.init.js @@ -52,55 +52,17 @@ $(document).ready(function(){ // Add drop shadows $(".gSelected").dropShadow(); - // In-place editing for tag admin - $(".gEditable").bind("click", editInplace); - // Add hover state for buttons $(".ui-state-default").hover( - function(){ - $(this).addClass("ui-state-hover"); - }, - function(){ - $(this).removeClass("ui-state-hover"); - } + function() { + $(this).addClass("ui-state-hover"); + }, + function() { + $(this).removeClass("ui-state-hover"); + } ); - }); -function closeEditInPlaceForms() { - // closes currently open inplace edit forms - if ($("#gRenameTagForm").length) { - var li = $("#gRenameTagForm").parent(); - $("#gRenameTagForm").parent().html($("#gRenameTagForm").parent().data("revert")); - 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 #name") - .width(tag_width+30) - .focus(); - $("#gRenameTagForm").parent().height('1.6em'); - $("#gRenameTagForm a").bind("click", closeEditInPlaceForms); -} - function handlePanelEvent(event) { togglePanel(event.currentTarget); event.preventDefault(); -- cgit v1.2.3