1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-14 10:45:54 +02:00

Fix ProcessTemplate and asmSelect issue processwire/processwire-issues#472

This commit is contained in:
Ryan Cramer
2018-01-11 09:51:47 -05:00
parent ad6f6bd283
commit b3ea132d81
3 changed files with 11 additions and 7 deletions

View File

@@ -619,11 +619,15 @@
var $asmSetDesc = $icontents.find('#' + options.listItemDescClass); // first try to find by ID
if($asmSetDesc.length == 0) $asmSetDesc = $icontents.find(':input.' + options.listItemDescClass); // then by class, if not ID
if($asmSetDesc.length > 0) {
$asmSetDesc = $asmSetDesc.eq(0);
$asmSetDesc = $asmSetDesc.eq(0);
var asmSetDesc = $('<textarea />').text($asmSetDesc.val()).html();
var $desc = $asmItem.find('.' + options.listItemDescClass);
var $descA = $desc.find('a'); // does it have an <a> in there?
if($descA.length > 0) $descA.html($asmSetDesc.val());
else $desc.html($asmSetDesc.val());
if($descA.length > 0) {
$descA.html(asmSetDesc);
} else {
$desc.html(asmSetDesc);
}
}
}
$iframe.dialog('close');

File diff suppressed because one or more lines are too long

View File

@@ -993,10 +993,10 @@ class ProcessTemplate extends Process {
$desc = $field->label;
$maxDesc = 30;
if(strlen($desc) > $maxDesc) {
$desc = $this->wire('sanitizer')->entities(substr($desc, 0, $maxDesc));
$desc = substr($desc, 0, $maxDesc);
$pos = strrpos($desc, ' ');
if($pos) $desc = substr($desc, 0, strrpos($desc, ' '));
$desc .= '&hellip;';
$desc .= '';
}
$status = str_replace('Fieldtype', '', $field->type);
@@ -1010,7 +1010,7 @@ class ProcessTemplate extends Process {
$attrs = array(
'data-status' => $icons . $status,
'data-desc' => $desc
'data-desc' => $this->wire('sanitizer')->entities($desc)
);
if($field->icon) {