-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hotfix release 2.3.27 Add support for SVG icons for toggler
- Loading branch information
Showing
3 changed files
with
14 additions
and
24 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
@@ -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 | ||
*/ | ||
|
@@ -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/)) { | ||
|
@@ -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'); | ||
} | ||
} | ||
} | ||
|
@@ -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')); | ||
} | ||
} | ||
} | ||
|