-
Bug
-
Resolution: Won't Do
-
Minor
-
None
-
3.3
-
MOODLE_33_STABLE
-
-
In MDL-40759 FontAwesome was added as an icon system to be used by a theme if desired. The title of the issue is 'Use the Font Awesome icon font for all icons in Moodle' however the function 'M.util.init_block_hider' in '/lib/javascript-static.js':
|
M.util.init_block_hider = function(Y, config) \{
|
Y.use('base', 'node', function(Y) \{
|
M.util.block_hider = M.util.block_hider || (function()\{
|
var blockhider = function() \{
|
blockhider.superclass.constructor.apply(this, arguments);
|
};
|
blockhider.prototype = \{
|
initializer : function(config) \{
|
this.set('block', '#'+this.get('id'));
|
var b = this.get('block'),
|
t = b.one('.title'),
|
a = null,
|
hide,
|
show;
|
if (t && (a = t.one('.block_action'))) \{
|
hide = Y.Node.create('<img />')
|
.addClass('block-hider-hide')
|
.setAttrs(\{
|
alt: config.tooltipVisible,
|
src: this.get('iconVisible'),
|
tabIndex: 0,
|
'title': config.tooltipVisible
|
});
|
hide.on('keypress', this.updateStateKey, this, true);
|
hide.on('click', this.updateState, this, true);
|
|
show = Y.Node.create('<img />')
|
.addClass('block-hider-show')
|
.setAttrs(\{
|
alt: config.tooltipHidden,
|
src: this.get('iconHidden'),
|
tabIndex: 0,
|
'title': config.tooltipHidden
|
});
|
show.on('keypress', this.updateStateKey, this, false);
|
show.on('click', this.updateState, this, false);
|
|
a.insert(show, 0).insert(hide, 0);
|
}
|
},
|
updateState : function(e, hide) \{
|
M.util.set_user_preference(this.get('preference'), hide);
|
if (hide) \{
|
this.get('block').addClass('hidden');
|
this.get('block').one('.block-hider-show').focus();
|
} else \{
|
this.get('block').removeClass('hidden');
|
this.get('block').one('.block-hider-hide').focus();
|
}
|
},
|
updateStateKey : function(e, hide) \{
|
if (e.keyCode == 13) \{ //allow hide/show via enter key
|
this.updateState(this, hide);
|
}
|
}
|
};
|
Y.extend(blockhider, Y.Base, blockhider.prototype, \{
|
NAME : 'blockhider',
|
ATTRS : \{
|
id : \{},
|
preference : \{},
|
iconVisible : \{
|
value : M.util.image_url('t/switch_minus', 'moodle')
|
},
|
iconHidden : \{
|
value : M.util.image_url('t/switch_plus', 'moodle')
|
},
|
block : \{
|
setter : function(node) \{
|
return Y.one(node);
|
}
|
}
|
}
|
});
|
return blockhider;
|
})();
|
new M.util.block_hider(config);
|
});
|
};
|
|
|
ignores this and injects an image directly rather than implementing the intent of the theme configuration setting: $THEME->iconsystem = \core\output\icon_system::FONTAWESOME;
So that the block hide / show icon is not replaced by a FontAwesome one.
Therefore 'Use the Font Awesome icon font for all icons in Moodle' is false and incomplete.