mirror of
https://github.com/processwire/processwire.git
synced 2025-08-15 03:05:26 +02:00
Fix ProcessTemplate and asmSelect issue processwire/processwire-issues#472
This commit is contained in:
@@ -619,11 +619,15 @@
|
|||||||
var $asmSetDesc = $icontents.find('#' + options.listItemDescClass); // first try to find by ID
|
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 = $icontents.find(':input.' + options.listItemDescClass); // then by class, if not ID
|
||||||
if($asmSetDesc.length > 0) {
|
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 $desc = $asmItem.find('.' + options.listItemDescClass);
|
||||||
var $descA = $desc.find('a'); // does it have an <a> in there?
|
var $descA = $desc.find('a'); // does it have an <a> in there?
|
||||||
if($descA.length > 0) $descA.html($asmSetDesc.val());
|
if($descA.length > 0) {
|
||||||
else $desc.html($asmSetDesc.val());
|
$descA.html(asmSetDesc);
|
||||||
|
} else {
|
||||||
|
$desc.html(asmSetDesc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$iframe.dialog('close');
|
$iframe.dialog('close');
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -993,10 +993,10 @@ class ProcessTemplate extends Process {
|
|||||||
$desc = $field->label;
|
$desc = $field->label;
|
||||||
$maxDesc = 30;
|
$maxDesc = 30;
|
||||||
if(strlen($desc) > $maxDesc) {
|
if(strlen($desc) > $maxDesc) {
|
||||||
$desc = $this->wire('sanitizer')->entities(substr($desc, 0, $maxDesc));
|
$desc = substr($desc, 0, $maxDesc);
|
||||||
$pos = strrpos($desc, ' ');
|
$pos = strrpos($desc, ' ');
|
||||||
if($pos) $desc = substr($desc, 0, strrpos($desc, ' '));
|
if($pos) $desc = substr($desc, 0, strrpos($desc, ' '));
|
||||||
$desc .= '…';
|
$desc .= '…';
|
||||||
}
|
}
|
||||||
|
|
||||||
$status = str_replace('Fieldtype', '', $field->type);
|
$status = str_replace('Fieldtype', '', $field->type);
|
||||||
@@ -1010,7 +1010,7 @@ class ProcessTemplate extends Process {
|
|||||||
|
|
||||||
$attrs = array(
|
$attrs = array(
|
||||||
'data-status' => $icons . $status,
|
'data-status' => $icons . $status,
|
||||||
'data-desc' => $desc
|
'data-desc' => $this->wire('sanitizer')->entities($desc)
|
||||||
);
|
);
|
||||||
|
|
||||||
if($field->icon) {
|
if($field->icon) {
|
||||||
|
Reference in New Issue
Block a user