Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
beyaz committed Jan 13, 2024
1 parent 37ffa38 commit 47394f1
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2666,6 +2666,25 @@ function CreateNewDeveloperError(message)
const DynamicStyles = [];
var ReactWithDotNetDynamicCssElement = null;

/**
*
* @param {String} cssSelector
* @returns {Number} ComponentUniqueIdentifier
*/
function GetComponentUniqueIdentifierFromCssSelector(cssSelector)
{
let startIndex = cssSelector.indexOf('._rwd_');
let endIndex = cssSelector.indexOf('_', startIndex + 6);

const componentUniqueIdentifier = parseInt(cssSelector.substring(startIndex + 6, endIndex));
if (isNaN(componentUniqueIdentifier))
{
throw CreateNewDeveloperError('componentUniqueIdentifier cannot calculated from ' + cssSelector);
}

return componentUniqueIdentifier;
}

function ProcessDynamicCssClasses(dynamicStyles)
{
if (dynamicStyles == null || dynamicStyles.length === 0)
Expand Down Expand Up @@ -2703,17 +2722,12 @@ function ProcessDynamicCssClasses(dynamicStyles)
if (shouldInsert)
{
hasChange = true;

let startIndex = cssSelector.indexOf('._rwd_');
let endIndex = cssSelector.indexOf('_', startIndex + 6);

const componentUniqueIdentifier = parseInt(cssSelector.substring(startIndex + 6, endIndex));
if (isNaN(componentUniqueIdentifier))
{
throw CreateNewDeveloperError('componentUniqueIdentifier cannot calculated from ' + cssSelector);
}

DynamicStyles.push({cssSelector: cssSelector, cssBody: cssBody, componentUniqueIdentifier: componentUniqueIdentifier});

DynamicStyles.push({
cssSelector: cssSelector,
cssBody: cssBody,
componentUniqueIdentifier: GetComponentUniqueIdentifierFromCssSelector(cssSelector)
});
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2666,6 +2666,25 @@ function CreateNewDeveloperError(message)
const DynamicStyles = [];
var ReactWithDotNetDynamicCssElement = null;

/**
*
* @param {String} cssSelector
* @returns {Number} ComponentUniqueIdentifier
*/
function GetComponentUniqueIdentifierFromCssSelector(cssSelector)
{
let startIndex = cssSelector.indexOf('._rwd_');
let endIndex = cssSelector.indexOf('_', startIndex + 6);

const componentUniqueIdentifier = parseInt(cssSelector.substring(startIndex + 6, endIndex));
if (isNaN(componentUniqueIdentifier))
{
throw CreateNewDeveloperError('componentUniqueIdentifier cannot calculated from ' + cssSelector);
}

return componentUniqueIdentifier;
}

function ProcessDynamicCssClasses(dynamicStyles)
{
if (dynamicStyles == null || dynamicStyles.length === 0)
Expand Down Expand Up @@ -2703,17 +2722,12 @@ function ProcessDynamicCssClasses(dynamicStyles)
if (shouldInsert)
{
hasChange = true;

let startIndex = cssSelector.indexOf('._rwd_');
let endIndex = cssSelector.indexOf('_', startIndex + 6);

const componentUniqueIdentifier = parseInt(cssSelector.substring(startIndex + 6, endIndex));
if (isNaN(componentUniqueIdentifier))
{
throw CreateNewDeveloperError('componentUniqueIdentifier cannot calculated from ' + cssSelector);
}

DynamicStyles.push({cssSelector: cssSelector, cssBody: cssBody, componentUniqueIdentifier: componentUniqueIdentifier});

DynamicStyles.push({
cssSelector: cssSelector,
cssBody: cssBody,
componentUniqueIdentifier: GetComponentUniqueIdentifierFromCssSelector(cssSelector)
});
}
}
}
Expand Down

0 comments on commit 47394f1

Please sign in to comment.