Light icon works, log scroll still broken
This commit is contained in:
parent
c4809047d5
commit
6dd6f755c9
|
@ -2485,8 +2485,8 @@ log.display = function (action, service, status, time) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
$('#grid_log_table').animate({
|
$('#grid_log_table').animate({
|
||||||
scrollTop: $('#grid_log_table').prop('scrollHeight')
|
scrollTop: $('#grid_log_table').prop('scrollHeight')
|
||||||
}, 0);
|
}, 100);
|
||||||
}, 1);
|
}, 100);
|
||||||
return obj;
|
return obj;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2506,7 +2506,14 @@ log.info = function (action, service, status, time) {
|
||||||
light.preview = false;
|
light.preview = false;
|
||||||
light.color = [0, 0, 0]; //preview status
|
light.color = [0, 0, 0]; //preview status
|
||||||
light.current = [0, 0, 0]; //last sent
|
light.current = [0, 0, 0]; //last sent
|
||||||
|
light.icon = {};
|
||||||
light.init = function () {
|
light.init = function () {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
light.icon = document.createElement('style');
|
||||||
|
light.icon.innerHTML = 'span.mcopy-light{background-color: #000;}';
|
||||||
|
document.body.appendChild(light.icon);
|
||||||
|
|
||||||
$('#colors-tabs').w2tabs({
|
$('#colors-tabs').w2tabs({
|
||||||
name: 'colors',
|
name: 'colors',
|
||||||
active: 'rgb',
|
active: 'rgb',
|
||||||
|
@ -2560,6 +2567,7 @@ light.init = function () {
|
||||||
customBG: '#222',
|
customBG: '#222',
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
size: 3,
|
size: 3,
|
||||||
|
appendTo : document.getElementById('rgb-page'),
|
||||||
// patch: false,
|
// patch: false,
|
||||||
init: function(elm, colors) { // colors is a different instance (not connected to colorPicker)
|
init: function(elm, colors) { // colors is a different instance (not connected to colorPicker)
|
||||||
elm.style.backgroundColor = elm.value;
|
elm.style.backgroundColor = elm.value;
|
||||||
|
@ -2605,15 +2613,15 @@ light.display = function (rgb) {
|
||||||
}
|
}
|
||||||
str = 'rgb(' + rgb.join(',') + ')';
|
str = 'rgb(' + rgb.join(',') + ')';
|
||||||
$('#color').css('background-color', str);
|
$('#color').css('background-color', str);
|
||||||
$('.mcopy-light').css('background-color', str);
|
light.icon = document.styleSheets[document.styleSheets.length - 1];
|
||||||
|
light.icon.deleteRule(0);
|
||||||
|
light.icon.insertRule('span.mcopy-light{background-color: ' + str + ';}', 0)
|
||||||
};
|
};
|
||||||
light.color_on = false;
|
light.color_on = false;
|
||||||
light.color_init = function () {
|
light.color_init = function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
if (!light.color_on) {
|
if (!light.color_on) {
|
||||||
$('#rgb').focus();
|
$('#rgb').focus();
|
||||||
$('.cp-app').appendTo('#rgb-page');
|
|
||||||
light.color_on = true;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2641,6 +2649,8 @@ nav.change = function (id) {
|
||||||
$('#' + id).show();
|
$('#' + id).show();
|
||||||
if (id === 'light') {
|
if (id === 'light') {
|
||||||
light.color_init();
|
light.color_init();
|
||||||
|
} else if (id === 'controls') {
|
||||||
|
w2ui['log'].resize();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -48,8 +48,8 @@ log.display = function (action, service, status, time) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
$('#grid_log_table').animate({
|
$('#grid_log_table').animate({
|
||||||
scrollTop: $('#grid_log_table').prop('scrollHeight')
|
scrollTop: $('#grid_log_table').prop('scrollHeight')
|
||||||
}, 0);
|
}, 100);
|
||||||
}, 1);
|
}, 100);
|
||||||
return obj;
|
return obj;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -69,7 +69,14 @@ log.info = function (action, service, status, time) {
|
||||||
light.preview = false;
|
light.preview = false;
|
||||||
light.color = [0, 0, 0]; //preview status
|
light.color = [0, 0, 0]; //preview status
|
||||||
light.current = [0, 0, 0]; //last sent
|
light.current = [0, 0, 0]; //last sent
|
||||||
|
light.icon = {};
|
||||||
light.init = function () {
|
light.init = function () {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
light.icon = document.createElement('style');
|
||||||
|
light.icon.innerHTML = 'span.mcopy-light{background-color: #000;}';
|
||||||
|
document.body.appendChild(light.icon);
|
||||||
|
|
||||||
$('#colors-tabs').w2tabs({
|
$('#colors-tabs').w2tabs({
|
||||||
name: 'colors',
|
name: 'colors',
|
||||||
active: 'rgb',
|
active: 'rgb',
|
||||||
|
@ -123,6 +130,7 @@ light.init = function () {
|
||||||
customBG: '#222',
|
customBG: '#222',
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
size: 3,
|
size: 3,
|
||||||
|
appendTo : document.getElementById('rgb-page'),
|
||||||
// patch: false,
|
// patch: false,
|
||||||
init: function(elm, colors) { // colors is a different instance (not connected to colorPicker)
|
init: function(elm, colors) { // colors is a different instance (not connected to colorPicker)
|
||||||
elm.style.backgroundColor = elm.value;
|
elm.style.backgroundColor = elm.value;
|
||||||
|
@ -168,15 +176,15 @@ light.display = function (rgb) {
|
||||||
}
|
}
|
||||||
str = 'rgb(' + rgb.join(',') + ')';
|
str = 'rgb(' + rgb.join(',') + ')';
|
||||||
$('#color').css('background-color', str);
|
$('#color').css('background-color', str);
|
||||||
$('.mcopy-light').css('background-color', str);
|
light.icon = document.styleSheets[document.styleSheets.length - 1];
|
||||||
|
light.icon.deleteRule(0);
|
||||||
|
light.icon.insertRule('span.mcopy-light{background-color: ' + str + ';}', 0)
|
||||||
};
|
};
|
||||||
light.color_on = false;
|
light.color_on = false;
|
||||||
light.color_init = function () {
|
light.color_init = function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
if (!light.color_on) {
|
if (!light.color_on) {
|
||||||
$('#rgb').focus();
|
$('#rgb').focus();
|
||||||
$('.cp-app').appendTo('#rgb-page');
|
|
||||||
light.color_on = true;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -204,6 +212,8 @@ nav.change = function (id) {
|
||||||
$('#' + id).show();
|
$('#' + id).show();
|
||||||
if (id === 'light') {
|
if (id === 'light') {
|
||||||
light.color_init();
|
light.color_init();
|
||||||
|
} else if (id === 'controls') {
|
||||||
|
w2ui['log'].resize();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue