mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
fixing buttons on mobile composer, and updating format so tags button only appears on mobile
This commit is contained in:
@@ -240,6 +240,7 @@ define('composer', [
|
||||
var template = (composer.bsEnvironment === 'xs' || composer.bsEnvironment === 'sm') ? 'composer-mobile' : 'composer';
|
||||
|
||||
var data = {
|
||||
mobile: template === 'composer-mobile',
|
||||
allowTopicsThumbnail: allowTopicsThumbnail,
|
||||
showTags: isTopic || isMain,
|
||||
minimumTagLength: config.minimumTagLength,
|
||||
|
||||
@@ -20,11 +20,11 @@ define('composer/formatting', ['composer/controls', 'composer/preview'], functio
|
||||
}
|
||||
};
|
||||
|
||||
var customButtons = [];
|
||||
var buttons = [];
|
||||
|
||||
formatting.addComposerButtons = function() {
|
||||
for(var x=0,numButtons=customButtons.length;x<numButtons;x++) {
|
||||
$('.formatting-bar .btn-group form').before('<span class="btn btn-link" tabindex="-1" data-format="' + customButtons[x].name + '"><i class="' + customButtons[x].iconClass + '"></i></span>');
|
||||
for(var x=0,numButtons=buttons.length;x<numButtons;x++) {
|
||||
$('.formatting-bar .btn-group form').before('<span class="btn btn-link" tabindex="-1" data-format="' + buttons[x].name + '"><i class="' + buttons[x].iconClass + '"></i></span>');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -32,7 +32,7 @@ define('composer/formatting', ['composer/controls', 'composer/preview'], functio
|
||||
var name = iconClass.replace('fa fa-', '');
|
||||
|
||||
formattingDispatchTable[name] = onClick;
|
||||
customButtons.push({
|
||||
buttons.push({
|
||||
name: name,
|
||||
iconClass: iconClass
|
||||
});
|
||||
|
||||
@@ -117,7 +117,7 @@ SocketModules.composer.stopNotifyTyping = function(socket, data) {
|
||||
SocketModules.composer.getFormattingOptions = function(socket, data, callback) {
|
||||
plugins.fireHook('filter:composer.formatting', {
|
||||
options: [
|
||||
// { className: 'fa fa-bold' } Just an example of what needs to be set via plugins
|
||||
{ name: 'tags', className: 'fa fa-tags', mobile: true }
|
||||
]
|
||||
}, function(err, payload) {
|
||||
callback(err, payload.options);
|
||||
|
||||
Reference in New Issue
Block a user