Forgiveness for the English

When you apply the value of a field in a form that is not submitted.

example:

php:
$imce_url = function_exists('imce_access') && imce_access() ? url('imce') : '';

return "js:
var B = eDefBrowseButton('$imce_url', 'attr_src', 'Browse', 'image');
var form = [
 {name: 'src', title: 'Image URL', suffix: B},
 {name: 'width', title: 'Width x Height', suffix: ' x ', getnext: true, attributes: {size: 3}},
 {name: 'height', attributes: {size: 3}},
 {name: 'alt', title: 'Alternative text'},
 {name: 'style', title: 'Image align', type: 'select', options: {'':'','float:left': 'Left', 'float:right': 'Right'}, value: 'float:left'} 
];
eDefTagDialog('img', form, 'Insert/edit image', 'OK');
";

The default does not apply:

value: 'float:left'

CommentFileSizeAuthor
#1 default_buttons_functions.js_.patch1.08 KBufku

Comments

ufku’s picture

Status: Active » Needs review
StatusFileSize
new1.08 KB

Confirmed.
Please try the patch attached.
or change line 181 of library/default_buttons_functions.js to:
if (field.name == 'html') field.value = typeof obj.innerHTML == 'string' ? obj.innerHTML : sel;

A possible workaround in your case could be removing the first empty element of options.

cantidubi’s picture

Status: Needs review » Closed (fixed)

Ok, thank you.
It works perfectly.
Congratulations on the module, it is very good.

ufku’s picture

Status: Closed (fixed) » Reviewed & tested by the community
ufku’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
Status: Reviewed & tested by the community » Fixed

committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.