if (showIcon) {
res += getSpriteIcon(name);
+
+ // Special case for icons that have an additional state
+ if (name == 'interface-fullscreen') {
+ res += getSpriteIcon('interface-fullscreen-exit');
+ }
}
// Only the Menu should have titles
// Full screen toggle
$(document).on('click', '.icon-fullscreen', function () {
- // ToDo: toggle menu icon according to state
+
+ // Need to toggle all instances of the icon so can't use $(this)
+ $('.icon-fullscreen').toggleClass('active');
$this.menuAPI.close();
screenfull.toggle();
fill: currentColor;
}
+/* Icon states */
+.icon-fullscreen {
+
+ // Full screen exit icon hidden by default
+ .interface-fullscreen-exit {
+ display: none;
+ }
+
+ // Switch icons
+ &.active {
+ .interface-fullscreen-exit {
+ display: inline-block;
+ }
+ .interface-fullscreen {
+ display: none;
+ }
+ }
+}
+
+
/* Webfonts*/
@font-face {