mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 19:15:58 +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 template = (composer.bsEnvironment === 'xs' || composer.bsEnvironment === 'sm') ? 'composer-mobile' : 'composer'; | ||||||
|  |  | ||||||
| 		var data = { | 		var data = { | ||||||
|  | 			mobile: template === 'composer-mobile', | ||||||
| 			allowTopicsThumbnail: allowTopicsThumbnail, | 			allowTopicsThumbnail: allowTopicsThumbnail, | ||||||
| 			showTags: isTopic || isMain, | 			showTags: isTopic || isMain, | ||||||
| 			minimumTagLength: config.minimumTagLength, | 			minimumTagLength: config.minimumTagLength, | ||||||
|   | |||||||
| @@ -20,11 +20,11 @@ define('composer/formatting', ['composer/controls', 'composer/preview'], functio | |||||||
| 		} | 		} | ||||||
| 	}; | 	}; | ||||||
|  |  | ||||||
| 	var customButtons = []; | 	var buttons = []; | ||||||
|  |  | ||||||
| 	formatting.addComposerButtons = function() { | 	formatting.addComposerButtons = function() { | ||||||
| 		for(var x=0,numButtons=customButtons.length;x<numButtons;x++) { | 		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="' + customButtons[x].name + '"><i class="' + customButtons[x].iconClass + '"></i></span>'); | 			$('.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-', ''); | 		var name = iconClass.replace('fa fa-', ''); | ||||||
|  |  | ||||||
| 		formattingDispatchTable[name] = onClick; | 		formattingDispatchTable[name] = onClick; | ||||||
| 		customButtons.push({ | 		buttons.push({ | ||||||
| 			name: name, | 			name: name, | ||||||
| 			iconClass: iconClass | 			iconClass: iconClass | ||||||
| 		}); | 		}); | ||||||
|   | |||||||
| @@ -117,7 +117,7 @@ SocketModules.composer.stopNotifyTyping = function(socket, data) { | |||||||
| SocketModules.composer.getFormattingOptions = function(socket, data, callback) { | SocketModules.composer.getFormattingOptions = function(socket, data, callback) { | ||||||
| 	plugins.fireHook('filter:composer.formatting', { | 	plugins.fireHook('filter:composer.formatting', { | ||||||
| 		options: [ | 		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) { | 	}, function(err, payload) { | ||||||
| 		callback(err, payload.options); | 		callback(err, payload.options); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user