Skip to content

Commit

Permalink
fix: remove mainClass from old selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
bziondik committed Oct 24, 2022
1 parent 5a931d4 commit 68a5e1a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion views/js/qtiCreator/editor/styleEditor/styleEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,16 @@ define([

request(_getUri('load'), _.extend({}, itemConfig, { stylesheetUri: href })).then(function (_style) {
// copy style to global style
style = _style;
style = {};

Object.keys(_style).forEach(key => {
if (!key.includes(mainClass)) {
style[key] = _style[key];
} else {
const selectorWithoutMainClass = key.replace(`.${mainClass}`, '').trim();
style[selectorWithoutMainClass] = _style[key];
}
})

// apply rules
create();
Expand Down

0 comments on commit 68a5e1a

Please sign in to comment.