summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Wall <richard@largo>2011-01-10 00:51:29 +0000
committerRichard Wall <richard@largo>2011-01-10 00:51:29 +0000
commit28c1497d0d027765020d3fc33170a934041de5b9 (patch)
treed382002757226c4aac707695d6d42fe5aec5a1f5
parent6afea2f598c07c36fd272f694a98cec7137ec875 (diff)
Re-enable tab title editing
-rw-r--r--jarmon/jarmon.js29
1 files changed, 29 insertions, 0 deletions
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 = $('<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(
+ $('<a/>', {
+ href: ['#', this.value].join('')
+ }).text(this.value)
+ )
+ self.setup();
+ self.$tabBar.data("tabs").click(this.value);
+ }
+ );
};
jarmon.TabbedInterface.prototype.newTab = function(tabName) {