Skip to content

Commit 15ae7b8

Browse files
pmusarajhnb-ku
authored andcommitted
FA5 compatibility fixes
1 parent c7cb340 commit 15ae7b8

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

common/header.html

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@
144144

145145

146146
<script type="text/discourse-plugin" version="0.8.23">
147+
const { iconHTML } = require("discourse-common/lib/icon-library");
148+
147149
let sec = "",
148150
seg = "",
149151
rawMain = "",
@@ -161,18 +163,19 @@
161163

162164
$.each(sec, function() {
163165
var sec = $.map(this.split(","), $.trim);
166+
var icon = sec[1].length && sec[1] != 'none' ? iconHTML(sec[1]) : '';
164167
rawMain +=
165168
'<a data-d-dropdown="#' +
166169
sec[0] +
167170
'" class="' +
168171
sec[3] +
169172
'" title="' +
170173
sec[2] +
171-
'"><i class="fa d-icon fa-' +
172-
sec[1] +
173-
'"></i>' +
174-
sec[0] +
175-
'<i class="fa fa-caret-down d-icon d-icon-caret-down"></i></a><div id="' +
174+
'">' +
175+
icon +
176+
sec[0] +
177+
iconHTML("caret-down") +
178+
'</a><div id="' +
176179
sec[0] +
177180
'" class="d-dropdown ' +
178181
rtlClass +
@@ -198,6 +201,8 @@
198201
if (seg[2] == null || seg[2] == " ") {
199202
seg[2] = "";
200203
}
204+
205+
var icon = seg[2].length && seg[2] != 'none' ? iconHTML(seg[2]) : '';
201206

202207
if (seg[4] == "blank") {
203208
seg[4] = "_blank";
@@ -219,9 +224,8 @@
219224
seg[5] +
220225
'" class="submenu-link" href="' +
221226
seg[3] +
222-
'"><i class="fa d-icon fa-' +
223-
seg[2] +
224-
'"></i>' +
227+
'">' +
228+
icon +
225229
seg[1] +
226230
"</li>";
227231
$("#" + sec[0] + " ul").html(mainUl);

settings.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ Submenu_items:
88
default: "Design, Galleries, th, #, blank, Cool galleries for you to look at.|Design, Design process, lightbulb-o, #, blank, Learn the basics.|Design, Blog design, columns, #, blank, What makes for a great blog?|Design, divider|Design, Freebies, gift, #, blank, Everyone likes freebies!|Design, Photoshop tutorials, book, #, blank, Photoshop for beginners.|Design, Design trends, bar-chart, #, blank, Stay on top of the current trends! |Code, Wordpress, wordpress, #, blank, Wordpress code examples|Code, Tools, wrench, #, blank, Tools that will make your life easier!|Code, Tutorials, leanpub, #, blank, Just starting out? We'll guide you through the basics|Business, Blogging, none, #, blank, Why not start a blog?|Business, Social media, none, #, blank, Learn how to leverage Social media and make it work for your business |Business, Make money, none, #, blank, Everyone like to be paid!|Business, Marketing, none, #, blank, No business will survive without customers...Here's how to get'em!|Shop, Vectors, none, #, blank,|Shop, Textures, none, #, blank,|Shop, Brushes, none, #, blank,|Shop, divider|Shop, UI kits, none, #, blank,|Shop, Templates , none, #, blank,|Shop, PSDs, none, #, blank,|More, About us, none, /about, self, Meet the gang!|More, Contact us, none, #, blank, Let's get in touch|More, Terms of Service, none, /tos, self, |More, Privacy policy, none, /privacy, self"
99
description:
1010
en: 'Add submenu items. One item per line in this order: Parent, text, icon, URL, target, title.<br><b>Parent:</b> the name of the parent menu item which this submenu item show under. Use the `text` value from the list above<br><b>Text:</b> the text that shows for this submenu item.<br><b>Icon:</b> the icon for this submenu item, use `none` if no icon is needed<br><b>URL:</b> the path this menu item links to. You can use relative paths as well.<br><b>Target:</b> Choose whether this item will open in a new tab or in the same tab. Use `blank` to open the link in a new tab, or use `self` to open it in the same tab.<br><b>Title:</b> the text that shows when the item is hovered.<br><b>Dividers:</b> You can also add dividers between submenu items. To add a divider user `parent, divider`'
11+
Svg_icons:
12+
type: 'list'
13+
list_type: 'compact'
14+
default: 'fa-magic|fa-keyboard-o|fa-money|fa-shopping-cart|fa-lightbulb-o|fa-columns|fa-gift|fa-book|fa-bar-chart|fa-wordpress|fa-wrench|fa-leanpub'
15+
description:
16+
en: "Include FontAwesome icon classes for each icon used in the lists above."
1117
Fixed_mode:
1218
default: false
1319
description:

0 commit comments

Comments
 (0)