Skip to content

Commit

Permalink
Merge tag '2.3.27'
Browse files Browse the repository at this point in the history
Hotfix release 2.3.27

Add support for SVG icons for toggler
  • Loading branch information
stefanheimes committed Jan 4, 2025
2 parents e787a0e + 7d0d7b8 commit 00a0cbf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 24 deletions.
16 changes: 2 additions & 14 deletions src/Resources/public/js/generalDriver.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Resources/public/js/generalDriver.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions src/Resources/public/js/generalDriver_src.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* This file is part of contao-community-alliance/dc-general.
*
* (c) 2013-2017 Contao Community Alliance.
* (c) 2013-2024 Contao Community Alliance.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -16,7 +16,8 @@
* @author Stefan Heimes <[email protected]>
* @author Tristan Lins <[email protected]>
* @author Sven Baumann <[email protected]>
* @copyright 2013-2017 Contao Community Alliance.
* @author Ingolf Steinhardt <[email protected]>
* @copyright 2013-2024 Contao Community Alliance.
* @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0
* @filesource
*/
Expand Down Expand Up @@ -152,9 +153,9 @@ var BackendGeneral =
if (img.nodeName.toLowerCase() == 'img') {
if (img.getParent('ul.tl_listing').hasClass('tl_tree_xtnd')) {
if (publish) {
img.src = img.src.replace(/_1\.(gif|png|jpe?g)/, '.$1');
img.src = img.src.replace(/_1\.(gif|png|jpe?g|svg)/, '.$1');
} else {
img.src = img.src.replace(/\.(gif|png|jpe?g)/, '_1.$1');
img.src = img.src.replace(/\.(gif|png|jpe?g|svg)/, '_1.$1');
}
} else {
if (img.src.match(/folPlus|folMinus/)) {
Expand All @@ -166,11 +167,11 @@ var BackendGeneral =
}
var index;
if (publish) {
index = img.src.replace(/.*_([0-9])\.(gif|png|jpe?g)/, '$1');
img.src = img.src.replace(/_[0-9]\.(gif|png|jpe?g)/, ((index.toInt() == 1) ? '' : '_' + (index.toInt() - 1)) + '.$1');
index = img.src.replace(/.*_([0-9])\.(gif|png|jpe?g|svg)/, '$1');
img.src = img.src.replace(/_[0-9]\.(gif|png|jpe?g|svg)/, ((index.toInt() == 1) ? '' : '_' + (index.toInt() - 1)) + '.$1');
} else {
index = img.src.replace(/.*_([0-9])\.(gif|png|jpe?g)/, '$1');
img.src = img.src.replace(/(_[0-9])?\.(gif|png|jpe?g)/, ((index == img.src) ? '_1' : '_' + (index.toInt() + 1)) + '.$2');
index = img.src.replace(/.*_([0-9])\.(gif|png|jpe?g|svg)/, '$1');
img.src = img.src.replace(/(_[0-9])?\.(gif|png|jpe?g|svg)/, ((index == img.src) ? '_1' : '_' + (index.toInt() + 1)) + '.$2');
}
}
}
Expand All @@ -187,9 +188,9 @@ var BackendGeneral =
// List view
else {
if (publish) {
img.setStyle('background-image', img.getStyle('background-image').replace(/_\.(gif|png|jpe?g)/, '.$1'));
img.setStyle('background-image', img.getStyle('background-image').replace(/_\.(gif|png|jpe?g|svg)/, '.$1'));
} else {
img.setStyle('background-image', img.getStyle('background-image').replace(/\.(gif|png|jpe?g)/, '_.$1'));
img.setStyle('background-image', img.getStyle('background-image').replace(/\.(gif|png|jpe?g|svg)/, '_.$1'));
}
}
}
Expand Down

0 comments on commit 00a0cbf

Please sign in to comment.