summaryrefslogtreecommitdiff
path: root/themes/admin_default/js/ui.init.js
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-03-17 20:59:24 +0000
committerBharat Mediratta <bharat@menalto.com>2009-03-17 20:59:24 +0000
commit7cf0313e7b8672d9757f565fd72c8e7dcf1a8904 (patch)
tree617bc7d0556dc6f6d2e4b5b192211f7bb66fa6e3 /themes/admin_default/js/ui.init.js
parentc81ee12411af5d26bbe4fe413ea7f6728d047ace (diff)
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.
Diffstat (limited to 'themes/admin_default/js/ui.init.js')
-rw-r--r--themes/admin_default/js/ui.init.js50
1 files changed, 6 insertions, 44 deletions
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 id="gRenameTagForm" method="post" action="/gallery3/index.php/admin/tags/rename/' + tag_id + '">';
- form += '<input id="name" name="name" type="text" class="textbox" value="' + tag_name + '" />';
- form += '<input type="submit" class="submit" value="Save" />';
- form += '<span>or</span> <a href="#">cancel</a>';
- form += '</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();