Skip to content

Commit 9db67e9

Browse files
Merge pull request #132 from alikaakati/master
fixed font size styling error when text is fetched from wysiwig
2 parents 2c18c09 + 382f25c commit 9db67e9

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"postinstall": "./node_modules/.bin/bower install",
99
"test": "./node_modules/.bin/karma start karma.conf.js",
1010
"build": "gulp build && cd .. && rm -rf folderPlugin_release.zip && zip -r folderPlugin_release.zip folderPlugin_release/",
11-
"preinstall": "npx npm-force-resolutions"
11+
"preinstall": "npx install npm-force-resolutions"
1212
},
1313
"resolutions": {
1414
"graceful-fs": "4.2.3"

widget/index.html

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
#txt h4 span,
104104
#txt h5 span,
105105
#txt h6 span {
106-
font-size: inherit !important;
106+
font-size: inherit;
107107
}
108108

109109
</style>
@@ -218,8 +218,10 @@
218218

219219
txt.innerHTML = '';
220220
if (layout != 12) {
221-
if (obj.data.content.text)
221+
if (obj.data.content.text){
222+
console.log(obj.data.content);
222223
txt.innerHTML = obj.data.content.text.trim();
224+
}
223225
}
224226
if (txt.innerHTML == '') {
225227
txt.classList.add('hide');
@@ -298,7 +300,7 @@
298300
var iIcon = document.createElement('i');
299301
iIcon.className += " main-icon " + p.iconClassName;
300302
if ([3, 4, 5, 6, 7, 9, 10, 11].indexOf(layout) > -1) {
301-
iIcon.style.fontSize = calcFontSize(options, layout) + "px";
303+
iIcon.style.fontSize = calcFontSize(options, layout) + "px !important";
302304
}
303305
span.append(iIcon);
304306
divImg.appendChild(span);
@@ -590,15 +592,15 @@
590592
let postitioning = document.createElement("style");
591593
let justifyContent = "center";
592594
let alignItems = "center";
593-
let fontSize = textFontSize ? textFontSize + "px" : "2.5vh";
595+
let fontSize = textFontSize ? textFontSize + "px !important" : "2.5vh";
594596
if(textAlignHorizontal) justifyContent = textAlignHorizontal;
595597
if(textAlignVertical) alignItems = textAlignVertical;
596598
let css = `{
597599
justify-content: ${justifyContent} !important;
598600
align-items: ${alignItems} !important;
599601
}`;
600602
let cssFontSize = `{
601-
font-size: ${fontSize} !important;
603+
font-size: ${fontSize};
602604
}`
603605
postitioning.innerHTML += `span ${cssFontSize}`
604606
switch (layout) {
@@ -1039,7 +1041,7 @@
10391041
}
10401042

10411043
.layout1 .pluginItem .media-holder.media-holder-icon .main-icon {
1042-
font-size: 15vw !important;
1044+
font-size: 15vw;
10431045
position: relative;
10441046
top: -1px;
10451047
}
@@ -1109,7 +1111,7 @@
11091111
}
11101112

11111113
.layout2 .pluginItem .media-holder.media-holder-icon .main-icon {
1112-
font-size: 18vw !important;
1114+
font-size: 18vw;
11131115
position: relative;
11141116
top: -1px;
11151117
}
@@ -1213,7 +1215,7 @@
12131215
}
12141216

12151217
.layout5 .pluginItem .media-holder.media-holder-icon .main-icon {
1216-
font-size: 48.8vw !important;
1218+
font-size: 48.8vw;
12171219
position: relative;
12181220
top: -1px;
12191221
}
@@ -1252,7 +1254,7 @@
12521254
}
12531255

12541256
.layout6 .pluginItem .media-holder.media-holder-icon .main-icon {
1255-
font-size: 42.4vw !important;
1257+
font-size: 42.4vw ;
12561258
position: relative;
12571259
top: -1px;
12581260
}
@@ -1332,7 +1334,7 @@
13321334
}
13331335

13341336
.layout8 .pluginItem .media-holder.media-holder-icon .main-icon {
1335-
font-size: 15vw !important;
1337+
font-size: 15vw ;
13361338
position: relative;
13371339
top: -1px;
13381340
}
@@ -1525,7 +1527,7 @@
15251527
}
15261528

15271529
.layout11 .pluginItem .media-holder.media-holder-icon .main-icon {
1528-
font-size: 48vw !important;
1530+
font-size: 48vw;
15291531
position: relative;
15301532
top: -1px;
15311533
}

0 commit comments

Comments
 (0)