From 28c1497d0d027765020d3fc33170a934041de5b9 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Mon, 10 Jan 2011 00:51:29 +0000 Subject: Re-enable tab title editing --- jarmon/jarmon.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/jarmon/jarmon.js b/jarmon/jarmon.js index 0b72949..d4f902c 100644 --- a/jarmon/jarmon.js +++ b/jarmon/jarmon.js @@ -1022,6 +1022,35 @@ jarmon.TabbedInterface = function($tpl, recipe) { } } ); + + $('ul.css-tabs > li > a', $tpl[0]).live( + 'dblclick', + {self: this}, + function(e) { + var $originalLink = $(this); + var $input = $('', { + 'value': $originalLink.text(), + 'name': 'editTabTitle' + }) + $originalLink.replaceWith($input); + $input.focus(); + } + ); + + $('ul.css-tabs > li > input[name=editTabTitle]', $tpl[0]).live( + 'blur', + {self: this}, + function(e) { + var self = e.data.self; + $(this).replaceWith( + $('', { + href: ['#', this.value].join('') + }).text(this.value) + ) + self.setup(); + self.$tabBar.data("tabs").click(this.value); + } + ); }; jarmon.TabbedInterface.prototype.newTab = function(tabName) { -- cgit v1.2.3-2-g168b