added icon container styles back to ACP, proper hooking-up of iconSelect module in group settings panel, #2588

v1.18.x
Julian Lam 10 years ago
parent 69ed8ac45d
commit 240056d169

@ -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 {
padding: 0 5px;

@ -1,7 +1,7 @@
"use strict";
/* globals define, socket, ajaxify, app */
define('forum/groups/details', ['iconSelect'], function(iconSelect) {
define('forum/groups/details', ['iconSelect', 'vendor/colorpicker/colorpicker'], function(iconSelect) {
var Details = {};
Details.init = function() {
@ -63,26 +63,27 @@ define('forum/groups/details', ['iconSelect'], function(iconSelect) {
colorValueEl = settingsFormEl.find('[name="labelColor"]'),
iconBtn = settingsFormEl.find('[data-action="icon-select"]'),
previewEl = settingsFormEl.find('.label'),
previewIcon = previewEl.find('i');
previewIcon = previewEl.find('i'),
previewValueEl = settingsFormEl.find('[name="icon"]');
if (settingsFormEl.length) {
// Add color picker to settings form
require(['vendor/colorpicker/colorpicker'], function() {
colorBtn.ColorPicker({
color: colorValueEl.val() || '#000',
onChange: function(hsb, hex) {
colorValueEl.val('#' + hex);
previewEl.css('background-color', '#' + hex);
},
onShow: function(colpkr) {
$(colpkr).css('z-index', 1051);
}
});
colorBtn.ColorPicker({
color: colorValueEl.val() || '#000',
onChange: function(hsb, hex) {
colorValueEl.val('#' + hex);
previewEl.css('background-color', '#' + hex);
},
onShow: function(colpkr) {
$(colpkr).css('z-index', 1051);
}
});
// Add icon selection interface
iconSelect.init(previewIcon, function() {
console.log(arguments);
iconBtn.on('click', function() {
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]]'));
}
if (meta.config.allowPrivateGroups) {
if (meta.config.allowPrivateGroups !== '0') {
groups.isPrivate(data.groupName, function(err, isPrivate) {
if (isPrivate) {
groups.requestMembership(data.groupName, socket.uid, callback);

Loading…
Cancel
Save