forked from 0x2620/pandora
use EditableContent to edit texts
This commit is contained in:
parent
c50db67150
commit
054d07fcf3
1 changed files with 3 additions and 5 deletions
|
@ -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'
|
||||||
|
|
Loading…
Reference in a new issue