mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
added icon container styles back to ACP, proper hooking-up of iconSelect module in group settings panel, #2588
This commit is contained in:
@@ -195,6 +195,25 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-container {
|
||||||
|
.row {
|
||||||
|
margin: 0;
|
||||||
|
i {
|
||||||
|
width:20px;
|
||||||
|
height:20px;
|
||||||
|
margin: 1px;
|
||||||
|
.pointer;
|
||||||
|
line-height: 20px;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
&:hover, &.selected {
|
||||||
|
background: black;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.navbar {
|
.navbar {
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
/* globals define, socket, ajaxify, app */
|
/* globals define, socket, ajaxify, app */
|
||||||
|
|
||||||
define('forum/groups/details', ['iconSelect'], function(iconSelect) {
|
define('forum/groups/details', ['iconSelect', 'vendor/colorpicker/colorpicker'], function(iconSelect) {
|
||||||
var Details = {};
|
var Details = {};
|
||||||
|
|
||||||
Details.init = function() {
|
Details.init = function() {
|
||||||
@@ -63,26 +63,27 @@ define('forum/groups/details', ['iconSelect'], function(iconSelect) {
|
|||||||
colorValueEl = settingsFormEl.find('[name="labelColor"]'),
|
colorValueEl = settingsFormEl.find('[name="labelColor"]'),
|
||||||
iconBtn = settingsFormEl.find('[data-action="icon-select"]'),
|
iconBtn = settingsFormEl.find('[data-action="icon-select"]'),
|
||||||
previewEl = settingsFormEl.find('.label'),
|
previewEl = settingsFormEl.find('.label'),
|
||||||
previewIcon = previewEl.find('i');
|
previewIcon = previewEl.find('i'),
|
||||||
|
previewValueEl = settingsFormEl.find('[name="icon"]');
|
||||||
|
|
||||||
if (settingsFormEl.length) {
|
if (settingsFormEl.length) {
|
||||||
// Add color picker to settings form
|
// Add color picker to settings form
|
||||||
require(['vendor/colorpicker/colorpicker'], function() {
|
colorBtn.ColorPicker({
|
||||||
colorBtn.ColorPicker({
|
color: colorValueEl.val() || '#000',
|
||||||
color: colorValueEl.val() || '#000',
|
onChange: function(hsb, hex) {
|
||||||
onChange: function(hsb, hex) {
|
colorValueEl.val('#' + hex);
|
||||||
colorValueEl.val('#' + hex);
|
previewEl.css('background-color', '#' + hex);
|
||||||
previewEl.css('background-color', '#' + hex);
|
},
|
||||||
},
|
onShow: function(colpkr) {
|
||||||
onShow: function(colpkr) {
|
$(colpkr).css('z-index', 1051);
|
||||||
$(colpkr).css('z-index', 1051);
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add icon selection interface
|
// Add icon selection interface
|
||||||
iconSelect.init(previewIcon, function() {
|
iconBtn.on('click', function() {
|
||||||
console.log(arguments);
|
iconSelect.init(previewIcon, function() {
|
||||||
|
previewValueEl.val(previewIcon.val());
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ SocketGroups.join = function(socket, data, callback) {
|
|||||||
return callback(new Error('[[error:invalid-data]]'));
|
return callback(new Error('[[error:invalid-data]]'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (meta.config.allowPrivateGroups) {
|
if (meta.config.allowPrivateGroups !== '0') {
|
||||||
groups.isPrivate(data.groupName, function(err, isPrivate) {
|
groups.isPrivate(data.groupName, function(err, isPrivate) {
|
||||||
if (isPrivate) {
|
if (isPrivate) {
|
||||||
groups.requestMembership(data.groupName, socket.uid, callback);
|
groups.requestMembership(data.groupName, socket.uid, callback);
|
||||||
|
|||||||
Reference in New Issue
Block a user