Skip to content

Commit

Permalink
[BUGFIX] copy/cut/ref after D'n'D action
Browse files Browse the repository at this point in the history
Resolves: #200
  • Loading branch information
Alexander Opitz committed Aug 14, 2018
1 parent fd48fbe commit d656f07
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Classes/Controller/BackendLayoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ public function buildButton($module, $title, $icon, $params = [], $buttonType =
]
)
);
$clickUrl = 'jumpToUrl(\'' . $url . '\');return false;';
$clickUrl = 'jumpToUrl(\'' . trim(json_encode(rawurldecode($url), JSON_HEX_APOS | JSON_HEX_QUOT), '"') . '\');return false;';
}
return $this->buildButtonFromUrl($clickUrl, $title, $icon, '', $buttonType, $extraClass, $rel);
}
Expand Down
4 changes: 3 additions & 1 deletion Classes/Module/Mod1/Clipboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ public function element_getSelectButtons($elementPointer, $listOfButtons = 'copy
'web_txtemplavoilaplusLayout',
$title,
$icon . ($isActive ? '-release' : ''),
$params
$params,
'default',
'tpm-' . $button
);
}
}
Expand Down
4 changes: 3 additions & 1 deletion Resources/Public/JavaScript/templavoila.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ function sortable_updateItemButtons(listSelector)
this.href = this.href.replace(/unlinkRecord\('[^']+'/, "unlinkRecord(\'" + newPos + "\'");
}
if ($this.hasClass('tpm-cut') || $this.hasClass('tpm-copy') || $this.hasClass('tpm-ref') ) {
this.href = this.href.replace(/CB\[el\]\[([^\]]+)\]=[^&]+/, "CB[el][$1]=" + newPos);
//this.setAttribute('onclick', encodeURI(decodeURI(this.getAttribute('onclick')).replace(/CB\[el\]\[([^\]]+)\]=[^&]+/, "CB[el][$1]=" + newPos)));

this.setAttribute('onclick', this.getAttribute('onclick').replace(/CB\[el\]\[([^\]]+)\]=[^&]+/, "CB[el][$1]=" + newPos));
}
if ($this.hasClass('tpm-pasteAfter') || $this.hasClass('tpm-pasteSubRef')) {
this.href = this.href.replace(/&destination=[^&]+/, "&destination=" + newPos);
Expand Down

0 comments on commit d656f07

Please sign in to comment.