use EditableContent to edit texts

This commit is contained in:
j 2013-09-26 21:37:44 +00:00
parent c50db67150
commit 054d07fcf3

View file

@ -231,9 +231,8 @@ pandora.ui.textHTML = function(text) {
margin: '16px', margin: '16px',
}).appendTo(that), }).appendTo(that),
$title = Ox.Editable({ $title = Ox.EditableContent({
editable: text.name ? text.editable : false, editable: text.name ? text.editable : false,
height: 32,
placeholder: text.editable ? Ox._('Doubleclick to edit title') : Ox._('Untitled'), placeholder: text.editable ? Ox._('Doubleclick to edit title') : Ox._('Untitled'),
tooltip: text.editable ? pandora.getEditTooltip('title') : '', tooltip: text.editable ? pandora.getEditTooltip('title') : '',
value: text.name || Ox._('{0} Texts', [pandora.site.site.name]), value: text.name || Ox._('{0} Texts', [pandora.site.site.name]),
@ -266,8 +265,9 @@ pandora.ui.textHTML = function(text) {
.css({height: '16px'}) .css({height: '16px'})
.appendTo($content), .appendTo($content),
$text = Ox.Editable({ $text = Ox.EditableContent({
clickLink: pandora.clickLink, clickLink: pandora.clickLink,
collapseToEnd: false,
editable: text.editable, editable: text.editable,
format: function(text) { format: function(text) {
var index = 0; var index = 0;
@ -287,7 +287,6 @@ pandora.ui.textHTML = function(text) {
} }
); );
}, },
maxHeight: height - 1,
placeholder: text.editable ? Ox._('Doubleclick to edit text') : '', placeholder: text.editable ? Ox._('Doubleclick to edit text') : '',
tooltip: text.editable ? pandora.getEditTooltip('text') : '', tooltip: text.editable ? pandora.getEditTooltip('text') : '',
type: 'textarea', type: 'textarea',
@ -334,7 +333,6 @@ pandora.ui.textHTML = function(text) {
that.update = function() { that.update = function() {
$text.options({ $text.options({
maxHeight: getHeight(),
width: getWidth() width: getWidth()
}).css({ }).css({
width: getWidth() + 'px' width: getWidth() + 'px'